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
Our React app was triggering the following error during navigation events:
Uncaught TypeError: Cannot read property 'firstChild' of undefined
The error was occurring in the function findComponentRoot, when it failed to find a component for an event callback.
In our app, this was happening when we would navigate during a blur event, and call unmountComponentAtNode on the rendering, in order to refresh the page. The docs for unmountComponentAtNode say
Remove a mounted React component from the DOM and clean up its event handlers and state
However, this does not seem to be the case. After we refresh the page with unmountComponentAtNode, there were other React-bound callbacks still in React's queue for that event. Leading to the error.
The docs and intuition seem to imply unmountComponentAtNode should clear these callbacks, since it knows the components will no longer exist to handle them.
The text was updated successfully, but these errors were encountered:
Since there's no repro provided and there's been no activity for almost 2 years, I'm going to close this out. If this is still an issue with the latest version of React, please provide an example reproduction the issue so we can verify.
Our React app was triggering the following error during navigation events:
Uncaught TypeError: Cannot read property 'firstChild' of undefined
The error was occurring in the function
findComponentRoot
, when it failed to find a component for an event callback.In our app, this was happening when we would navigate during a blur event, and call
unmountComponentAtNode
on the rendering, in order to refresh the page. The docs forunmountComponentAtNode
sayHowever, this does not seem to be the case. After we refresh the page with
unmountComponentAtNode
, there were other React-bound callbacks still in React's queue for that event. Leading to the error.The docs and intuition seem to imply
unmountComponentAtNode
should clear these callbacks, since it knows the components will no longer exist to handle them.The text was updated successfully, but these errors were encountered: