@@ -18,7 +18,7 @@ import {
18
18
19
19
import PropTypes from 'prop-types' ;
20
20
const ViewPropTypes = RNViewPropTypes || View . propTypes ;
21
- export const DURATION = {
21
+ export const DURATION = {
22
22
LENGTH_SHORT : 500 ,
23
23
FOREVER : 0 ,
24
24
} ;
@@ -49,6 +49,7 @@ export default class Toast extends Component {
49
49
{
50
50
toValue : this . props . opacity ,
51
51
duration : this . props . fadeInDuration ,
52
+ useNativeDriver : this . props . useNativeAnimation
52
53
}
53
54
)
54
55
this . animation . start ( ( ) => {
@@ -70,6 +71,7 @@ export default class Toast extends Component {
70
71
{
71
72
toValue : 0.0 ,
72
73
duration : this . props . fadeOutDuration ,
74
+ useNativeDriver : this . props . useNativeAnimation
73
75
}
74
76
)
75
77
this . animation . start ( ( ) => {
@@ -148,7 +150,8 @@ Toast.propTypes = {
148
150
positionValue :PropTypes . number ,
149
151
fadeInDuration :PropTypes . number ,
150
152
fadeOutDuration :PropTypes . number ,
151
- opacity :PropTypes . number
153
+ opacity :PropTypes . number ,
154
+ useNativeAnimation :PropTypes . bool
152
155
}
153
156
154
157
Toast . defaultProps = {
@@ -157,5 +160,6 @@ Toast.defaultProps = {
157
160
positionValue : 120 ,
158
161
fadeInDuration : 500 ,
159
162
fadeOutDuration : 500 ,
160
- opacity : 1
163
+ opacity : 1 ,
164
+ useNativeAnimation : false
161
165
}
0 commit comments