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

Usage of children as a function pattern #7988

Closed
RohovDmytro opened this issue Aug 31, 2017 · 2 comments
Closed

Usage of children as a function pattern #7988

RohovDmytro opened this issue Aug 31, 2017 · 2 comments

Comments

@RohovDmytro
Copy link

RohovDmytro commented Aug 31, 2017

I believe this pattern is nice to be used in material-ui — it gives a good level of flexibility.

image

It's an idea to discuss. Do someone feels good about applying this to material-ui? Your thoughts?

downshift and react-toggled are build with that and it they look very powerful.

@RohovDmytro RohovDmytro changed the title Usage of pattern Usage of children as a function pattern Aug 31, 2017
@oliviertassinari
Copy link
Member

Compound components is an interesting pattern. We haven't found a use case for it yet. The main pros I see with this pattern is the flexibility it offers. The main cons I see is around performance. Does creating new functions at each render hurt? To be cautious.

The closest pattern we have is cristalized by the muiName component static property.

@oliviertassinari
Copy link
Member

So, thanks for raising this voice, be sure we will think about it for the components we haven't migrated yet. This pattern could be potentially used for the TimePicker/DatePicker components. We will see.

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

No branches or pull requests

2 participants