3 ms·
Redux Form really goes against the spirit of Redux in my opinion. It uses Redux internally, but you can't really directly access the reducer it uses, so from t
by ykler 10y ago
Redux Form really goes against the spirit of Redux in my opinion. It uses Redux internally, but you can't really directly access the reducer it uses, so from the user's perspective it is almost like it's not using Redux. The one serious library choice mistake I made in my first React/Redux app was using Redux Form. It was almost impossible to do things if the library hadn't anticipated my exact use case. I ended up having to rip out a bunch of code, and I switched to React Redux Form[1] even though it was a very immature library at the time.
[1]: https://github.com/davidkpiano/react-redux-form https://github.com/davidkpiano/react-redux-form
- allover 10y agoHonest question, what is the reason for using a global store for form validation? That seems like the ideal use-case for local component state.
- ykler 10y agoIn my case, I had an editor for a structured document where the user could modify some parts of the document using a form and others using other components, some of which used forms internally. I wanted to have the whole document represented as an object in my Redux store that was also synced to the server.
- allover 10y agoGotcha, thanks! Seems a shame that Redux-Form (and similar) are presented for more trivial solutions than yours. I don't see many forms that also need modification via 'other components', in a way in which that state can't just be handled by a sensible parent component.