useReanimatedProps with custom component not updating on iOS
See original GitHub issueDescription
I’m trying to update text like ReText from react-native-redash. This is working correctly on Android but not on iOS.
Screenshots
Android (where it is working):
Steps To Reproduce
- Update shared value
- Update text via animatedProps
Expected behavior
Text should update without rerender.
Actual behavior
Text does not update.
Snack or minimal code example
const sliderValue = useSharedValue(25);
const formatted = useDerivedValue(
() => ${sliderValue.value}
,
[currentSliderValue],
);
<ReText text={formatted} style={{ color: ‘black’ }} />
Package versions
- React: 16.13.1
- React Native: 0.63.2
- React Native Reanimated: 2.0.0-rc.1
- NodeJS: v12.16.2
- React Native Redash: 16.0.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Updating custom props on UI thread does not work on iOS
When using third party components it is no longer possible to register additional properties to be updated directly on the UI thread. With ......
Read more >React Native Reanimated + SVG + Custom Component Not ...
I am trying to create a custom svg component (a rocket) that I then turn into an animated component using reanimated, so that...
Read more >useAnimatedProps | React Native Reanimated
The animatedProps property is added when a native component is wrapped with Animated.createAnimatedComponent . If the animated props worklet uses any shared ...
Read more >Updating a state causes animation in animatedProps to reset ...
Coding example for the question Reanimated 2: Updating a state causes animation in animatedProps to reset despite not changing the shared value-React ...
Read more >Reanimated 2 - the new approach to creating animations in ...
We are going to build practical examples of animated sliders using the new Reanimated 2 API and our custom useSlider hook.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The PR https://github.com/software-mansion/react-native-reanimated/pull/1584 does fix it for my app on iOS 👍 . I can’t test if there are consequences for Android as I have an issue with building it from that commit 😖 .