Bug #22381
openReplace redux-form
Description
The The primary goal of this issue is to remove errors that appear in the browser console when using workbench. The redux-form library is outdated and throw multiple console warnings whenever a form using it is used in workbench. We already use an alternative for some of our forms, provided by MUI, although it may not cover all use cases:
https://mui.com/material-ui/react-dialog/#form-dialogs
Other options include Formik and React Hook Form:
https://formik.org/
https://react-hook-form.com/
The primary performance drawback to redux-form is that it stores every bit of form state in the redux store. The Modern view on this is that form state, with a few exceptions, should be managed from within the form component, keeping the data closer to where it is relevant and favoring composition.
Some other reasons for replacing redux-form:- Performance Issues: Because redux-form stores the entire form state in the Redux store, any state change (e.g., typing into a field) triggers a Redux action and updates the global store, potentially causing unnecessary re-renders.
- Complexity: It adds unnecessary complexity often requires more boilerplate compared to alternatives, making the code harder to read and maintain.
- Debugging Overhead: The increased number of Redux actions can clutter debugging tools like Redux DevTools, making it harder to isolate issues.
- Alternatives Offer Better Features, such as:
- Better Performance
- Simplicity
- Integration with Modern Features, such as React Hooks
- Better Developer Experience: More concise APIs, better documentation, and larger active communities.
A cursory search of Workbench shows that redux-form is used in 125 files.
Updated by Lisa Knox 17 days ago
- Related to Bug #22231: Clean up MUI and react warnings/errors that appear on the browser console added