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

createContext: uid clash when developing npm linked packages #52

Open
Andarist opened this issue Apr 3, 2018 · 2 comments
Open

createContext: uid clash when developing npm linked packages #52

Andarist opened this issue Apr 3, 2018 · 2 comments

Comments

@Andarist
Copy link
Contributor

Andarist commented Apr 3, 2018

Each npm linked package has its own set of node_modules, therefore there might be multiple copies of react-broadcasts required by an app (all with the same version). Each of them ofc maintains its own uid counter but broadcasts is a shared key on legacy context and all those copies override what the put in context.

Don't have better idea on how to deal with it than randomizing broadcasts key (at least in development), thoughts? Can prepare a PR handling this if you find it worthwhile.

@mjackson
Copy link
Member

mjackson commented Apr 3, 2018

The best solution would be to use a Symbol, but I'm not sure about the best way to support browsers that don't have it, like IE 11.

@Andarist
Copy link
Contributor Author

Andarist commented Apr 3, 2018

Me neither 😉This could be used in development mode only though, npm link rather shouldnt be used in production environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants