@@ -18,7 +18,7 @@ import {
1818
1919import PropTypes from 'prop-types' ;
2020const ViewPropTypes = RNViewPropTypes || View . propTypes ;
21- export const DURATION = {
21+ export const DURATION = {
2222 LENGTH_SHORT : 500 ,
2323 FOREVER : 0 ,
2424} ;
@@ -49,6 +49,7 @@ export default class Toast extends Component {
4949 {
5050 toValue : this . props . opacity ,
5151 duration : this . props . fadeInDuration ,
52+ useNativeDriver : this . props . useNativeAnimation
5253 }
5354 )
5455 this . animation . start ( ( ) => {
@@ -70,6 +71,7 @@ export default class Toast extends Component {
7071 {
7172 toValue : 0.0 ,
7273 duration : this . props . fadeOutDuration ,
74+ useNativeDriver : this . props . useNativeAnimation
7375 }
7476 )
7577 this . animation . start ( ( ) => {
@@ -148,7 +150,8 @@ Toast.propTypes = {
148150 positionValue :PropTypes . number ,
149151 fadeInDuration :PropTypes . number ,
150152 fadeOutDuration :PropTypes . number ,
151- opacity :PropTypes . number
153+ opacity :PropTypes . number ,
154+ useNativeAnimation :PropTypes . bool
152155}
153156
154157Toast . defaultProps = {
@@ -157,5 +160,6 @@ Toast.defaultProps = {
157160 positionValue : 120 ,
158161 fadeInDuration : 500 ,
159162 fadeOutDuration : 500 ,
160- opacity : 1
163+ opacity : 1 ,
164+ useNativeAnimation : false
161165}
0 commit comments