Fix react popup unload error
Repository details (talkie)
- Project page
- talkie
- Project log category
- talkie (708 entries)
- Repository
- @joelpurra/talkie
- Owner
- @joelpurra
- Issues
- Issues on Github
- Contributors
- Contributors on Github
- Project status
- ⏲️ This project has had recent commits.
- 📂 This project is open.
- 🌠 This project is popular.
- Repository activity period
- 🗓—
- Commits
- 751 commits
- Stars
- 72 stars
Commit details (ad2e4894)
- Author
- Joel Purra
- Authored at
- Committer
- Joel Purra
- Committed at
Commit message
Fix react popup unload error
- Due to async broadcast event listeners, some calls might come very late in the page lifecycle.
- Not sure what the exact cause is, but guessing it has to do with how browsers unload extension popups.
- There seems to be a timing where a broadcast event is triggering
setState()
in such a way that react will try to re-render the content after they have disappeared from the DOM.- React has special detection code running in development mode, which may affet the debugging in itself.
- Adding more checks to try to prevent the error.
See
- https://github.com/facebook/react/pull/10270
- https://github.com/facebook/react/blob/37e4329bc81def4695211d6e3795a654ef4d84f5/packages/react-reconciler/src/ReactFiberScheduler.js#L770
- https://github.com/facebook/react/blob/46b3c3e4ae0d52565f7ed2344036a22016781ca0/packages/shared/invokeGuardedCallback.js#L151-L161
Raw text
Fix react popup unload error - Due to async broadcast event listeners, some calls might come very late in the page lifecycle. - Not sure what the exact cause is, but guessing it has to do with how browsers unload extension popups. - There seems to be a timing where a broadcast event is triggering `setState()` in such a way that react will try to re-render the content after they have disappeared from the DOM. - React has special detection code running in development mode, which may affet the debugging in itself. - Adding more checks to try to prevent the error. See - https://github.com/facebook/react/pull/10270 - https://github.com/facebook/react/blob/37e4329bc81def4695211d6e3795a654ef4d84f5/packages/react-reconciler/src/ReactFiberScheduler.js#L770 - https://github.com/facebook/react/blob/46b3c3e4ae0d52565f7ed2344036a22016781ca0/packages/shared/invokeGuardedCallback.js#L151-L161