図形を徐々に拡大
App.js
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View, Button } from 'react-native';
import Animated, {useSharedValue} from 'react-native-reanimated';
export default function App() {
const width = useSharedValue(100);
const handlePress = () => {
}
return (
<View style={styles.container}>
<Animated.View style={{...styles.box, width:width}} />
<Button onPress={handlePress} title="Click me"/>
</View>
);
}
const styles = StyleSheet.create({
container: {
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
box: {
height:100,
backgroundColor: 'violet'
}
});