简体   繁体   中英

Is there a way to refresh a page when ReactJS error happens?

Is there a way to refresh the whole page when any JS error happens? I have unique error that happens very infrequently.

You are looking for Error Boundaries . Set up a handler to reload the page. The only caveat is that you have to know the component causing the error. Or you can bootstrap your whole app

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM