-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check that container exists before calling removeChildren
#286
Conversation
This addresses an error I've repeatedly encountered in production (may have something to do with `React.Suspense` and/or `React.lazy` imports. Just ensures that the container exists before attempting to remove it. ``` TypeError: Cannot read properties of null (reading 'removeChildren') at removeChildren (../../src/ReactPixiFiber.js:122:12) at xb (../../node_modules/react-reconciler/cjs/react-reconciler.production.min.js:131:296) at Jf (../../node_modules/react-reconciler/cjs/react-reconciler.production.min.js:174:304) at ih (../../node_modules/react-reconciler/cjs/react-reconciler.production.min.js:171:235) at vc (../../node_modules/react-reconciler/cjs/react-reconciler.production.min.js:36:324) at Pc (../../node_modules/react-reconciler/cjs/react-reconciler.production.min.js:169:278) at Zg (../../node_modules/react-reconciler/cjs/react-reconciler.production.min.js:160:369) ```
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit aa060d6:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kyle-villeneuve! Seems like an obvious fix. I will merge and release it if you can update code formatting.
Co-authored-by: Michał Ochman <[email protected]>
Ok, I've committed your suggestion, thanks. @michalochman |
@kyle-villeneuve thanks! The fix is now included in |
This addresses an error I've repeatedly encountered in production (may have something to do with
React.Suspense
and/orReact.lazy
imports. Just ensures that the container exists before attempting to remove its contents.