generated at
useSharedValue

JS側とNative側で同期される状態を作る
これをShared Valueと呼ぶ






ts
const width = useSharedValue(100); const handlePress = () => { width.value = width.value + 50; };
.value で値にアクセスできる
.value をmutableに更新する
useRefと同じイメージだmrsekut

値はrnr: Animatedのstyleにそのまま渡す
ts
import Animated from 'react-native-reanimated'; <Animated.View style={{ width, height: 100, backgroundColor: 'violet', }} />
インラインで計算はできない
NG(ts)
<Animated.View style={{ width: width * 5 }} />
こういうのがしたい場合は、
上記のように関数を用意するか、