[PoC] feat: support for animating text inside Animated.Text#8595
[PoC] feat: support for animating text inside Animated.Text#8595
Animated.Text#8595Conversation
7270154 to
485fd5a
Compare
…a separate example
|
What will be the right way to sync the animation shared value with React state? Should we use a I mean, this is the most common scenario when using this pattern for example, when receiving a number from an API to animate the text. |
|
@RodolfoSilva I think the best way to go is to do it like this: const myValueFromAPI = useValueFromAPI();
const sv = useSharedValue<number>(myValueFromAPI);
useEffect(() => {
sv.value = withTiming(myValueFromAPI);
}, [myValueFromAPI]);
const textSv = useDerivedValue(() => {
return sv.value.toFixed(2);
});
return <Animated.Text text={textSv} />; |
|
how much % to completion this is? i'm been testing this feature for my implementation by patching the library.
|
|
@novatech Thanks for the feedback! There's one thing that needs to be fixed prior to merging – the incorrect behavior of |
|
Would love from this to be merged this month, that would make our lives easier as react native 82 in android dropped the support of extending internal classes and now our package 'react-native-animateable-text' is very hard to implement in android axelra-ag/react-native-animateable-text#76 so if this is merged soon, we will direct our users to use this solution instead. |
|
Bug 1: Screen.Recording.2026-02-08.at.19.37.55.movNote: I was able to fix it (only for between the first and second render) by passing const updaterFunction = () => {
'worklet';
const update = getInlinePropsUpdate(newInlineProps);
- updateProps(shareableViewDescriptors, update);
+ updateProps(shareableViewDescriptors, update, true);
}; |
|
is this coming into next release anytime soon? 🙏 |
## Summary This PR mentions #8595 in the docs as well as adds info about SwiftUI numeric transitions. ## Test plan

Summary
Work in progress.
Fixes the issue with cropped
TextInputand visible ellipsis.TODO: update docs https://docs.swmansion.com/react-native-reanimated/docs/guides/performance/#-animate-textinput-instead-of-re-rendering-text-component
Test plan