File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -108,22 +108,19 @@ class ToastContainer extends Component {
108108 } ;
109109 }
110110
111- componentWillMount ( ) {
111+ componentDidMount = ( ) => {
112112 Dimensions . addEventListener ( 'change' , this . _windowChanged ) ;
113113 if ( this . props . keyboardAvoiding ) {
114114 Keyboard . addListener ( 'keyboardDidChangeFrame' , this . _keyboardDidChangeFrame ) ;
115115 }
116- }
117-
118- componentDidMount = ( ) => {
119116 if ( this . state . visible ) {
120117 this . _showTimeout = setTimeout ( ( ) => this . _show ( ) , this . props . delay ) ;
121118 }
122119 } ;
123120
124- componentWillReceiveProps = nextProps => {
125- if ( nextProps . visible !== this . props . visible ) {
126- if ( nextProps . visible ) {
121+ componentDidUpdate = prevProps => {
122+ if ( this . props . visible !== prevProps . visible ) {
123+ if ( this . props . visible ) {
127124 clearTimeout ( this . _showTimeout ) ;
128125 clearTimeout ( this . _hideTimeout ) ;
129126 this . _showTimeout = setTimeout ( ( ) => this . _show ( ) , this . props . delay ) ;
@@ -132,7 +129,7 @@ class ToastContainer extends Component {
132129 }
133130
134131 this . setState ( {
135- visible : nextProps . visible
132+ visible : this . props . visible
136133 } ) ;
137134 }
138135 } ;
You can’t perform that action at this time.
0 commit comments