skip to Main Content

What should I pass as a value to a prop expecting Animated.Value while using react-native-reanimated? – React native

I created a hook to capture the react-native-pager-view carousel scroll position: import { useEvent, useHandler } from 'react-native-reanimated'; import { AnimatedPagerScrollHookParams } from './animated-pager-scroll.type'; const useAnimatedPagerScroll = ( handlers: AnimatedPagerScrollHookParams['handlers'], dependencies?: AnimatedPagerScrollHookParams['dependencies'], ) => { const { context, doDependenciesDiffer }…

VIEW QUESTION

Is it not possible to change styles through JS in React Native?

Can't RN do style changes using JS? ... const PR = PanResponder.create({ onStartShouldSetPanResponder: (e, gestureState) => true, onPanResponderStart: (e, gestureState) => { console.log("start"); }, onPanResponderMove: (e, gestureState) => { const dx = Math.abs(gestureState.dx); **target.current.style.backgroundColor** = `rgba(${dx},${dx / 2},106,1)`; }, onPanResponderEnd:…

VIEW QUESTION

When swiping react native app – screens shows twice

Live example https://snack.expo.dev/su1-U5DZc If I swipe screens with buttons - everything okay, but if I swipe with gesture - screens shows twice. Why so? Does this setWtf(state.index); const onTouchStart = (e, state, context) => { console.log('onTouchStart: ' + state.index); setWtf(state.index);…

VIEW QUESTION
Back To Top
Search