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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mount/Unmount count to avoid unstyling #4

Closed
cusspvz opened this issue May 30, 2016 · 2 comments
Closed

Mount/Unmount count to avoid unstyling #4

cusspvz opened this issue May 30, 2016 · 2 comments

Comments

@cusspvz
Copy link

cusspvz commented May 30, 2016

I was thinking on writing a decorator which would enable or disable style/usable webpack modules on mount and unmount... Guess what, you already had! 馃幆 THANKS! :D

Just one thing, this could possibly have an issue. I was thinking on having my decorator with a sort of a counter, so it would only unload styles when there aren't components mounted.

One brief example could be a button component, you could have one on a page header, if you enter a page where you have another, it will load styles again, but if you navigate outside of that page, the button o the header would be without styling. And I don't see where you're predicting that behavior on the code yet.

@bloodyowl
Copy link
Owner

the counter is on webpack plugin's side (https://github.com/bloodyowl/react-styled/blob/master/src/index.js#L31, decrement on each unmount) this should work directly (or do you have a repro to show unusual behaviour with this?)

@cusspvz
Copy link
Author

cusspvz commented May 30, 2016

Oh!! NICEEE!

I've tested it and it worked, also checked your statement, didn't know bout it, sorry.

do you have a repro to show unusual behaviour with this?

No, please ignore this issue. :)

@cusspvz cusspvz closed this as completed May 30, 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