silverstripe / silverstripe-admin

Silverstripe Admin Component
BSD 3-Clause "New" or "Revised" License
25 stars 94 forks source link

NOTE: Redux Form's author advises to use React Final Form instead #1266

Open micschk opened 2 years ago

micschk commented 2 years ago

(probably already on the radar but leaving here just in case it was not)

On trying to update some modules to work with react rendered forms I noticed the below info on the Redux Form repo

⚠️ ATTENTION ⚠️

If you're just getting started with your application and are looking for a form solution, the general consensus of the community is that you should not put your form state in Redux. The author of Redux Form took all of the lessons he learned about form use cases from maintaining Redux Form and built 🏁 React Final Form, which he recommends you use if you are just starting your project. It's also pretty easy to migrate to from Redux Form, because the <Field> component APIs are so similar. Here is a blog post where he explains his reasoning, or there are two talks if you prefer video. Formik is also a nice solution.

The only good reason, in the author's view, to use Redux Form in your application is if you need really tight coupling of your form data with Redux, specifically if you need to subscribe to it and modify it from parts of your application far from your form component, e.g. on another route. If you don't have that requirement, use 🏁 React Final Form.

Just in case Silverstripe is using davidkpiano/react-redux-form instead(?), that shows a similar notice:

⚠️ This project is in maintenance mode only. Please consider using Formik instead.

Adding this issue here, closing previously opened issue on silverstripe/silverstripe-framework.

unclecheese commented 2 years ago

Yeah, this package was abandoned shortly after SS4 was released. Gotta love frontend dev.

The reasoning behind keeping form state out of your app state is pretty sound. React hook form is really the best thing out there now, but we're several major refactors away from being able to extract all that logic out of redux.