-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
RSG puts components into global namespace #325
Comments
A good solution would be to extend code that we use for the |
For historical purposes here's my initial stab at this issue. It works but is a bit too dirty of a hack. |
@n1313 That really doesn't look that hacky to me. Is there any side effects I am not seeing? I would love to see this get added! (Currently having to rename my |
@rcline Doesn’t look super hacky to me now, and I’m sure we can avoid a global variable here. Feel free to send a pull request for that ;-) |
@sapegin It looks like this code has been changed/moved. react-styleguidist/src/rsg-components/Preview/Preview.js Lines 54 to 56 in d07e825
Any direction on where to look to make a similar change? (passing in namespaced components to a |
Not sure which code has been moved where ;-) I think the right place to do it is here: react-styleguidist/loaders/examples-loader.js Lines 22 to 23 in 916e173
But it’ll require some experiments, you’ll need to move props-loader call there I think:
|
I am also having that issues, I'm not sure if I understand the fix, did anybody tried @sapegin solution? |
Yup. This makes things very difficult when your library has dependencies to third party code. E.g. in my specific case i have a dependency to a component which in turn depends on a component named |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Feel free to send a pull request with a fix, commenting that you also have a known issue won't help anyone. |
All components that are loaded into the styleguide are put into the
global
namespace, so I think it is possible to accidentally overwrite properties ofwindow
with an unfortunately named component.The text was updated successfully, but these errors were encountered: