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

Warn when there is more than one instance of ReactPerf in the page #7010

Closed
felipethome opened this issue Jun 10, 2016 · 3 comments
Closed

Comments

@felipethome
Copy link

felipethome commented Jun 10, 2016

@gaearon I normally bundle React and all its add-ons in a different file from my application, but when using ReactPerf I forgot of including it in the same bundle of React and ReactDOM, so I noticed I was receiving an empty array from ReactPerf functions every time I was using them, and that is because ReactDebugTool is different for the application and for React which means flushHistory is also different.

What do you think about warning the user if there are more than one instance of ReactPerf/ReactDebugTool in the page?

@gaearon
Copy link
Collaborator

gaearon commented Jun 10, 2016

This seems like the same issue as "duplicate React".

Can you share more into about how your setup ended up including two Reacts? It is not immediately obvious. Did you use UMD bundle and a CommonJS module?

@felipethome
Copy link
Author

Of course, I did a demo. If you run the browserify version you will see the problem I'm talking about. I'm using CommonJS, but not UMD.

I'm familiar with the duplicate React issue, this is not the same. My setup doesn't end up with two React, but with two ReactDebugTool.

This seems to happen just with browserify, not webpack, so probably it is an issue with browserify or my set up is wrong.

@gaearon
Copy link
Collaborator

gaearon commented Jun 16, 2016

I’m not sure what’s wrong there but I suspect it’s related to the “vendor” configuration in Webpack config. I’m not a Webpack expert so I’m not sure how we can help here, but it’s not an issue on React side so I’ll close. We will be changing how we package things anyway as part of #6351, and there is also #6812 which is very related to this issue, so let’s continue discussion there.

@gaearon gaearon closed this as completed Jun 16, 2016
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

No branches or pull requests

2 participants