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

Don't crash in event handling when mixing React copies #4747

Merged
merged 1 commit into from Sep 10, 2015

Conversation

sophiebits
Copy link
Collaborator

Should fix #1939.

Test Plan:
With two copies of React, render a div using React1 and use that as a container to render a div with React2. Add onMouseEnter/onMouseLeave to both divs that log. Mouse around and see correct logs (as if each React was isolated), no errors.

@sophiebits
Copy link
Collaborator Author

Would be nice to get this in 0.14. I don't think it should change behavior if you're using a single React renderer.

Should fix facebook#1939.

Test Plan:
With two copies of React, render a div using React1 and use that as a container to render a div with React2. Add onMouseEnter/onMouseLeave to both divs that log. Mouse around and see correct logs (as if each React was isolated), no errors.
@sophiebits
Copy link
Collaborator Author

@sebmarkbage Updated to avoid n^2 loop and removed isRenderedByReact in favor of just using getFirstReactDOM which takes about the same amount of work.

@sebmarkbage
Copy link
Collaborator

Ok. Not too happy about this but let's work on perf / fixing the id tagging separately.

sophiebits added a commit that referenced this pull request Sep 10, 2015
Don't crash in event handling when mixing React copies
@sophiebits sophiebits merged commit a05691f into facebook:master Sep 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running two copies of React on a page can give errors because both use ID '.0'
3 participants