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
Describe the bug
When i using customLoading to set status for pre-loading with request api, i can't set customLoading equals TRUE again with another request.
Expected behavior
Can setting customLoading and preloader is display again with each request
Code
In my render function <h1>My app</h1> <Lines customLoading={this.state.loading} /> <button onClick={() => this.setState({ loading: true })}>Another Request</button> <h3>{this.state.loading ? 'true' : 'false' } </h3>
When i change state by click button "Another Request", state has change, but my preloader not reset customLoading and have no display preloader
The text was updated successfully, but these errors were encountered:
I met the same issue, and push a PR.
Or you can edit the package file in the project, of cos, for temporary usage.
In './node_modules/react-preloaders/Preloader/StyledPreloader.js',
// from line 84bodyScroll();(0,_react.useEffect)(function(){if(customLoading===false){setTimeout(function(){setLoading(false);},time);}if(customLoading===undefined){document.onreadystatechange=function(){if(document.readyState==='complete'){setTimeout(function(){setLoading(false);},time);}};}if(customLoading===true){// added these 3 linessetLoading(true);}},[customLoading]);
Describe the bug
When i using customLoading to set status for pre-loading with request api, i can't set customLoading equals TRUE again with another request.
Expected behavior
Can setting customLoading and preloader is display again with each request
Code
In my render function
<h1>My app</h1>
<Lines customLoading={this.state.loading} />
<button onClick={() => this.setState({ loading: true })}>Another Request</button>
<h3>{this.state.loading ? 'true' : 'false' } </h3>
When i change state by click button "Another Request", state has change, but my preloader not reset customLoading and have no display preloader
The text was updated successfully, but these errors were encountered: