Skip to content

Instantly share code, notes, and snippets.

@tpjnorton
Last active October 5, 2020 19:10
Show Gist options
  • Save tpjnorton/5abb2ac67e6a3b90b59a484b5001cae9 to your computer and use it in GitHub Desktop.
Save tpjnorton/5abb2ac67e6a3b90b59a484b5001cae9 to your computer and use it in GitHub Desktop.
const MovingBox = () => {
const progress = useSharedValue(0);
useEffect(() => {
setTimeout(() => {
progress.value = 100;
}, 1000);
}, []);
const style = useAnimatedStyle(() => ({
transform: [{translateX: progress.value}],
background: 'blue';
height: 10,
width: 10
}));
return <Animated.View style={style} />;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment