davidkpiano / react-redux-form

Create forms easily in React with Redux.
https://davidkpiano.github.io/react-redux-form
MIT License
2.07k stars 251 forks source link

Question: React Native + ImmutableJS #678

Open abudel opened 7 years ago

abudel commented 7 years ago

Just a simple question, for the web version we have to use react-redux-form/immutable, but for React Native we have to use react-redux-form/native, and this onedo not support Immutable. How we can link the native components with immutableJS support? We have to clone react-redux-form/native and replace the import

import { modelReducer, formReducer, modeled, actions, combineForms, initialFieldState, actionTypes, Control, Form, Fieldset, Errors, batched, form, getField, track, } from './index'; whit this: import { modelReducer, formReducer, modeled, actions, combineForms, initialFieldState, actionTypes, Control, Form, Fieldset, Errors, batched, form, getField, track, } from 'react-redux-form/immutable' Is this correct, or i missing something? Thanks

davidkpiano commented 7 years ago

It's a bit more complicated than that. If I have time, I'll work on it as an enhancement. I do not use Immutable.JS so it is not a priority for me - I strongly feel that Immutable.JS is a heavy burden on the project, especially given its ad-hoc data structures that provide little benefit (more details here: https://www.reddit.com/r/javascript/comments/4rcqpx/dan_abramov_redux_is_not_an_architecture_or/d51g4k4/ ). I'd strongly recommend using something like icepick or seamless-immutable instead, which work with normal JavaScript objects and arrays.

abudel commented 7 years ago

Thanks for the advice!