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

react-csjs #50

Open
tizmagik opened this issue Jul 26, 2016 · 2 comments
Open

react-csjs #50

tizmagik opened this issue Jul 26, 2016 · 2 comments

Comments

@tizmagik
Copy link

I don't know if this is helpful or not, but in comparing the various CSS in JS techniques, I stumbled across csjs, Aphrodite and JSS. I liked the interface that react-jss allows and noticed there wasn't an equivalent HoC for csjs.

So I've written one: react-csjs.

The initial implementation is admittedly very basic and bare-bones, but it provided enough utility for me that I figured it may help others and I decided to publish it. Let me know your thoughts -- happy to improve/change things around in any way you see fit.

Thanks!

@rtsao
Copy link
Owner

rtsao commented Jul 26, 2016

This is awesome! Cool idea of unmounting styles when the component unmounts. I might need to update docs with an ecosystem section...

@tizmagik
Copy link
Author

tizmagik commented Jul 27, 2016

Yea, the only issue is that it doesn't currently include the "extended" styles, which I would expect as a user of react-csjs given the API it allows. See #51

Any pointers on how to achieve that for react-csjs? I guess I could hold on to a singleton instance of csjs internally in the module, but there would be an issue with styles rendered "outside" of react-csjss control. Is this the pattern you'd recommend, or is there some other way? Maybe also exposing the csjs singleton as a named export as part of the API would be good, too:

import withStyles, {csjs} from 'react-csjs';

Where csjs is the singleton. Not sure if that actually helps or adds confusion though...

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