You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<Textstyle={styles.buttonText}>Ease in, Ease out</Text>
47
-
</View>
48
-
</TouchableOpacity>
49
-
<TouchableOpacityonPress={reset}>
50
-
<Viewstyle={styles.button}>
51
-
<Textstyle={styles.buttonText}>Reset</Text>
52
-
</View>
53
-
</TouchableOpacity>
54
-
</View>
55
-
);
56
-
};
57
-
58
-
exportdefaultApp;
59
-
60
-
const styles =StyleSheet.create({
61
-
box: {
62
-
backgroundColor: 'tomato',
63
-
height: 200,
64
-
width: 200,
65
-
},
66
-
button: {
67
-
backgroundColor: 'black',
68
-
marginTop: 15,
69
-
paddingHorizontal: 20,
70
-
paddingVertical: 15,
71
-
},
72
-
buttonText: {
73
-
color: '#fff',
74
-
fontWeight: 'bold',
75
-
},
76
-
container: {
77
-
alignItems: 'center',
78
-
flex: 1,
79
-
justifyContent: 'center',
80
-
},
81
-
});
82
-
```
6
+
[Scan the QR code and run the snack on your `iOS` or `Android` device](https://snack.expo.io/@iamkarlmarx/usestatewithlayoutanimation). (It does not work on web)
83
7
84
8
## API
9
+
10
+
### `useStateWithLayoutAnimation`
85
11
By default, `UIManager.setLayoutAnimationEnabledExperimental` is invoked, you can pass `false` as the second parameter if you want to call it on your own.
You can pass a callback as second parameter to `setState` animation functions to be called when animation is finished
15
+
### `setState.spring`
16
+
### `setState.linear`
17
+
### `setState.easeInEaseOut`
18
+
You can use this the same as `useState` setter, accepts values or optional callback function but accepts a second parameter for the animation finish callback.
0 commit comments