mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.59k stars 32.2k forks source link

Improve form library integration #15585

Open tobytraylor opened 5 years ago

tobytraylor commented 5 years ago

Perhaps Material UI should maintain their own integrations?

In your documentation you list

oliviertassinari commented 5 years ago

@tobytraylor Thank you for opening this issue. We document 4 integration in https://next.material-ui.com/demos/text-fields/#complementary-projects. I have recently removed uniforms-material so we compound people energy around a few popular solutions.

Regarding the trends in the community, it seems people are moving away from redux-form to use formik instead (stats). But If you look at the download stats compared to React, it seems that most people don't use a form library at all, same trend within Material-UI 🤔.

I think that we should prioritize our integration in the following order:

  1. formik cc @jhoffmcd
  2. final-form cc @Deadly0
  3. redux-form cc @erikras

I think that the first step is to update the documentation to change the order.

have all fallen apart

This is not fair, I would rather say that there are opportunities to improve the current state of affairs.

jhoffmcd commented 5 years ago

I recently integrated Formik into a project a few weeks ago with no problems using formik-material-ui. The biggest problem there was just documentation. Is this a proposal to make the integration more seamless? Also I was using v3, do we need to update for v4?

tobytraylor commented 5 years ago

Just wondering, what field types did you use? Basic TextField works fine but it took a while to get the TextField type="date" to format correctly. Took a while to figure out you have to add:

InputLabelProps={{
                                        shrink: true,
                                      }}

And I still haven't gotten the select to look or function correctly. If you figured out how to make it work correctly i'd appreciate the hints.

The formik-material-ui is the only one that mostly works right now. Final form material ui i had to edit each one of the field implementation to get them to kinda work.

oliviertassinari commented 5 years ago

@jhoffmcd v4 support should be identical. I'm not aware of any change that would impact the integration.

By the way, if we could get your feedback on https://github.com/mui-org/material-ui/issues/11377#issuecomment-489188714, it would be awesome, especially regarding the dilemma we face.

jhoffmcd commented 5 years ago

@tobytraylor I'll see if I can work on an examples section for formik-material-ui. It could show each use cases for all the supported input types. If the interop can be done better I can take a look as well.

oliviertassinari commented 5 years ago

@tobytraylor What issues to you see in https://codesandbox.io/s/9ywq085k9w?

tobytraylor commented 5 years ago

My requirements are to use the filled field. When updating it to use variant="filled":

There was a third issue i ran into that required me to C&P the select wrapper and make edits to work around Typescript issues relating to inputProps which might in the end have just been a type issue but i started trying out formik and formik material ui at that point.

lookfirst commented 4 years ago

17943 (i'm working on a modern react-final-form implementation)