-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
Add official support for createStyled? #11047
Comments
@oliviertassinari at a quick glance it does not seem so. The title of that issue is not immediately suggesting of having anything to do with a render props, the phrase "render prop" does not appear anywhere in that page, and I do not see any single code example showing a render prop pattern to access classes. |
@gnapse Ok thanks. Going back to your suggestion.
I fear the |
Ok, yes, I totally get it. Now again, back to my fallback suggestion here: why |
@gnapse The initial motivation was: it's working, but it's an extra API to support. Let's document it and see how it's used in the wild. Now, as people start using it and rely on it in production with no issue, I'm more confidence integrating it into the core. I have no real objection to it. It just hasn't been a priority so far. You know, extending the API comes with overhead: documentation, tests, maintenance, etc. |
Yes, sure. I get your point. Thanks for your input on this. |
@gnapse I'm reopening as it's a good question. I don't have a definitive answer. |
@jcoreio Has published the package under https://github.com/jcoreio/material-ui-render-props-styles. Maybe we could document it? At some point, it might be good to move |
I have added material-ui-render-props-styles of @jedwards1211 in the documentation with #11983. This should do it for now :). |
Awesome, thanks! I guess I don't get notifications for jcoreio for some reason |
Let me know if you want to move it to the |
@jedwards1211 Sure, I will let you know if we want to move the project into the npm organization. |
This is awesome. Thanks! |
Just an FYI - @oliviertassinari we had a |
I was wondering if this library could provide (or if it already does) a component that would allow to use styles with a render prop pattern, instead of the
withStyles
HOC.I searched for it, and the best I could find was this, but that's not quite what I would've expected. That option would need users of this api to create a new component every time:
I wonder if it would be a bit better or even possible to have a generic component that receives styles and provides classes, instead of having to create one component tied to specific styles:
Also, as a side note, even if this suggestion is not accepted, I wonder why the
createStyled
helper is not provided as an export of this library, just aswithStyles
is.The text was updated successfully, but these errors were encountered: