Open yuhh8899 opened 2 years ago
Even with the code on the github it still crash
+1
+1
+1 with the latest release 16.3.0
it should be fixed part of 16.3.0, could you send me an example to reproduce the issue?
it should be fixed part of 16.3.0, could you send me an example to reproduce the issue?
@wcandillon here is how I am using it. I am also on reanimated 2.8.0
and it crashes without any stacktrace in the console.
import React, { useEffect } from 'react'
import { StyleSheet, View } from 'react-native'
import { colors } from 'app/theme'
import { withPause } from "react-native-redash"
import Animated, { Easing, useAnimatedStyle, useSharedValue, withTiming} from 'react-native-reanimated'
import { SCREEN_WIDTH } from 'app/constants'
const ProgressBar = ({ loading }) => {
const paused = useSharedValue(true)
const progressWidth = useSharedValue(0)
const progressStyle = useAnimatedStyle(() => {
return {
width: withTiming(progressWidth.value, {
duration: 10000,
easing: Easing.linear
})
}
})
useEffect(() => {
if (loading) {
progressWidth.value = withPause(SCREEN_WIDTH, paused)
} else {
paused.value = true
}
}, [loading])
return (
<View style={[styles.base]}>
<Animated.View style={[progressStyle, styles.base, styles.progress]} />
</View>
)
}
export default ProgressBar
@wcandillon I might be using it wrong cause when I wrap the value with withTiming()
as shown in the docs it doesn't crash but the animation doesn't work.
withPause(withTiming(SCREEN_WIDTH, paused))
shouldn't it be:
withPause(withTiming(SCREEN_WIDTH), paused)
@wcandillon nevermind I figured it out! I forgot to set paused.value
to false
🤦 . It does crash still though if not used with withTiming
on my end.
Which other function other than withTiming would you like to use it for? I use it with withRepeat for instance.
@wcandillon I don't need it with any other function, withTiming
works perfectly for my case. I was just putting withTiming
in the useAnimatedStyle
instead of where the new shared value is being set
I am currently using react-native 0.66.3, reanimated 2.3.0-beta.3 and redash 16.2.2. I followed your tutorial on start-react-native.dev (the high-order animations video) and my program just crash with error: Cannot read property '__nodeId' of undefined, here are the code:
I am a newbie in reanimated so i can't know where the problem was I am running on android 12 emulator