Skip to content

Make sure to only mount components once per DOM node #79

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

Closed
wants to merge 1 commit into from

Conversation

glittershark
Copy link
Contributor

I've been encountering an issue where on initial page load the event
handler for page:change was getting fired twice, causing the React
components to be mounted twice, which caused all sorts of trouble. This
introduces a simple map of DOM nodes to booleans that acts as a guard
against nodes getting components mounted to them more than once.

I've been encountering an issue where on initial page load the event
handler for `page:change` was getting fired twice, causing the React
components to be mounted twice, which caused all sorts of trouble. This
introduces a simple map of DOM nodes to booleans that acts as a guard
against nodes getting components mounted to them more than once.
@sophiebits
Copy link
Member

React.renderComponent should be idempotent though…

@glittershark
Copy link
Contributor Author

So is the issue here actually that trying to render an identical component to a node twice isn't working properly for this version of React?

@sophiebits
Copy link
Member

I don't know what the issue is but the fix proposed here sounds off to me.

@jtmalinowski
Copy link
Collaborator

@glittershark how about we start with a repro case?

@meleyal
Copy link
Contributor

meleyal commented Aug 25, 2014

I think this is the same issue as #69

@zpao
Copy link
Member

zpao commented Sep 7, 2014

Just merged #69. Can you see if this is still occurring for you @glittershark?

@glittershark
Copy link
Contributor Author

@zpao that does it!

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.

5 participants