Update ANIMATED.md

This commit is contained in:
Marc Rousavy 2021-02-23 09:43:09 +01:00 committed by GitHub
parent faa43f1f5e
commit 6863876763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,7 @@ export const App = () => {
style={StyleSheet.absoluteFill} style={StyleSheet.absoluteFill}
device={device} device={device}
isActive={true} isActive={true}
{...{ animatedProps }} animatedProps={animatedProps}
/> />
<TouchableOpacity <TouchableOpacity
style={styles.zoomButton} style={styles.zoomButton}
@ -74,4 +74,4 @@ export const App = () => {
> Note that this might not be needed in the future, see: [reanimated#1409](https://github.com/software-mansion/react-native-reanimated/pull/1409) > Note that this might not be needed in the future, see: [reanimated#1409](https://github.com/software-mansion/react-native-reanimated/pull/1409)
3. Using [`useSharedValue`](https://docs.swmansion.com/react-native-reanimated/docs/api/useSharedValue), we're creating a shared value that holds the `zoom` property. 3. Using [`useSharedValue`](https://docs.swmansion.com/react-native-reanimated/docs/api/useSharedValue), we're creating a shared value that holds the `zoom` property.
4. Using the [`useAnimatedProps`](https://docs.swmansion.com/react-native-reanimated/docs/api/useAnimatedProps) hook, we apply the shared value to the animated props. 4. Using the [`useAnimatedProps`](https://docs.swmansion.com/react-native-reanimated/docs/api/useAnimatedProps) hook, we apply the shared value to the animated props.
5. We apply the animated props to the `ReanimatedCamera` component using the spread syntax. 5. We apply the animated props to the `ReanimatedCamera` component's `animatedProps` property.