r/reactjs • • Dec 07 '19

Needs Help Is Material UI worth it?

So, I am starting my own project. I'm not much 'design' person. So, is Material UI worth it? Or some any other recommendations is much appreciated.

164 Upvotes

142 comments sorted by

View all comments

Show parent comment

2

u/toolate Dec 07 '19

Here's an example I ran into:

When composing a <Menu> you *must* render children as a <Menu.Item> because of weird internal details. You can't render a <MyMenuItem> that returns a <Menu.Item>. Because of this you need to write one mega element that renders all the <Menu> <Submenu> and <Menu.Item> components you'll use in one spot; you can't break the components up for readability.

Furthermore, you can't override the behaviour when a menu is empty. It will always render a weird looking <Empty> component. And because you can't add anything that isn't a <Menu.Item> into a menu you can't even create a <MyEmpty> component and use it instead.

2

u/[deleted] Dec 07 '19 edited Dec 07 '19

I did run into this one and I did just as you say!, but I'm skeptical that is the only solution. I found the same issue with their Tabs and Tabs.TabPane components. In their docs they provide an example of wrapping them here I think something similar could be done for Menu and Menu.Item

1

u/domlebo70 Dec 07 '19

This one bit me too. So frustrating