Closed frankLife closed 6 years ago
I found the code in Provider.js
Provider.js
if (this.state.isClient && !this.alertRootElement) { this.alertRootElement = document.createElement('div') document.body.appendChild(this.alertRootElement) } else { return null }
I use the react-alert like example
react-alert
render(){ return ( <AlertProvider template={AlertTemplate} {...options}> <App /> </AlertProvider> ) }
when I setState the state of App and the render function start to run . The logic of alert provider would return null and page render blank.
setState
null
I update the componentWillUpdate logic same with the componentWillUnmount of the provider. It seems works right.
componentWillUpdate
componentWillUnmount
What should I do for this ? Is there anything I mistake ? @schiehll ❓
Should be fixed after #70.
Be sure to put the Provider in your root component.
Provider
If you still get the error after the update, feel free to reopen!
I found the code in
Provider.js
I use the
react-alert
like examplewhen I
setState
the state of App and the render function start to run . The logic of alert provider would returnnull
and page render blank.I update the
componentWillUpdate
logic same with thecomponentWillUnmount
of the provider. It seems works right.What should I do for this ? Is there anything I mistake ? @schiehll ❓