MCPcopy Create free account
hub / github.com/dabbott/react-native-express / MyComponent

Function MyComponent

examples/files/animation/animatedExample.tsx:4–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2import { Animated, Button } from 'react-native'
3
4export default function MyComponent() {
5 const value = useRef(new Animated.Value(0))
6
7 return (
8 <>
9 <Button
10 title="Animate"
11 onPress={() => {
12 const animation = Animated.timing(value.current, {
13 toValue: 1,
14 useNativeDriver: true,
15 })
16
17 animation.start()
18 }}
19 />
20 <Animated.Text style={{ opacity: value.current, fontSize: 42 }}>
21 Hello!
22 </Animated.Text>
23 </>
24 )
25}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected