Update ANIMATED.md

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

View File

@ -30,24 +30,24 @@ import Reanimated, {
useAnimatedProps,
useSharedValue,
withSpring,
} from "react-native-reanimated";
} from "react-native-reanimated"
const ReanimatedCamera = Reanimated.createAnimatedComponent(Camera);
const ReanimatedCamera = Reanimated.createAnimatedComponent(Camera)
Reanimated.addWhitelistedNativeProps({
zoom: true,
});
})
export const App = () => {
const zoom = useSharedValue(0);
export function App() {
const zoom = useSharedValue(0)
const onRandomZoomPress = useCallback(() => {
zoom.value = withSpring(Math.random());
}, []);
zoom.value = withSpring(Math.random())
}, [])
const animatedProps = useAnimatedProps<Partial<CameraProps>>(
() => ({ zoom: zoom.value }),
[zoom]
);
)
return (
<>