Skip to content
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

Fix reactOnRailsPageUnloaded when there is no component on the page #1499

Closed
wants to merge 2 commits into from

Conversation

justin808
Copy link
Member

@justin808 justin808 commented Dec 23, 2022

From #1498.

In reactOnRailsPageLoaded, if we finds no react component, the function return and context.roots is not initialized. This cause findContext().roots in reactOnRailsPageUnloaded to be undefined, and for .. of throws an exception.

This should mostly affect app using both hotwire and react_on_rails, as the recommended way to load js is to do the same file everywhere, otherwise the issue can be avoided by just not loading react_on_rails


This change is Reviewable

@justin808
Copy link
Member Author

Merged #1498.

@justin808 justin808 closed this Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants