From b77cad7cd6445fdd23bfcb5e1fa26351243a5533 Mon Sep 17 00:00:00 2001 From: Jonny Burger Date: Mon, 16 Nov 2020 19:52:26 +0100 Subject: [PATCH] chore: update readme --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bf6b582..e1382e0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,29 @@ # react-native-animateable-text -<Text> that supports animated value +A `` component that supports an Animated Value as text! + +## Usage (Reanimated 2) + +```tsx +import AnimateableText from 'react-native-animateable-text'; + +const Example: React.FC = () => { + const text = useSharedValue('World'); + + const animatedText = useDerivedValue(() => `Hello ${text.value}`); + const animatedProps = useAnimatedProps(() => { + return { + text: animatedText.value, + }; + }); + + return ( + ; +}; +```