Shmew/Feliz.MaterialUI

Consider adding seq<ReactElement> overloads

Closed this issue · 7 comments

Hi @cmeeren, I started to use the library, so far getting started is simple, just install the library and you are good to go and use the elements directly. However, I noticed that the elements do not support seq<ReactElement> overloads like the Feliz helpers do, would be awesome if you could add them

Are there any particular elements where you'd like this?

I haven't added it for two reasons:

  • In general, I expect MUI users will want to supply non-children props 99% of the time
  • Not all MUI elements support children

If there are any particular elements where you think it would make sense, let me know! And if you disagree with my reasoning, I'm certainly willing to hear you out.

In general I agree with both of your points now that I have taken a closer look into the docs of Mui, I guess only with a couple of these elements that it would make sense to it, the first one that struck out to me was Mui.buttonGroup, I was playing with two buttons and I wanted to see how they looked like in a button group element. A couple more I could think of are Mui.list and Mui.card

It is worth noting that even though I agree that a user in real-world scenario would use props usually, someone who is just playing around or prototyping would find these overloads helpful

Maybe Mui.menuItem as well

Also Mui.toolbar (I am just scrolling through examples in the docs and seeing that a couple of these elements never have props)

Thanks! Let me know when you are done looking and I will add it to the components where you think it makes sense.

By the way, won't F# be unable to discern between the prop list and element list overloads when using an empty list?

Not really, Feliz already works around it like this