Skip to content

Latest commit

 

History

History
30 lines (24 loc) · 739 Bytes

immutable.md

File metadata and controls

30 lines (24 loc) · 739 Bytes

Immutable.js

React Redux Form, as of the latest version, has support for Immutable.JS. To use it, just import the parts you need from react-redux-form/immutable:

import Immutable from 'immutable';
import {
  Form,
  Control,
  actions,
  // ... etc.
} from 'react-redux-form/immutable';
// ... other imports

class MyForm extends Component {
  render() {
    return (
      <Form model="user">
        <Control model=".name" />
        
        {/* ... other controls */}
      </Form>
    );
  }
}

export default MyForm;

and it will just work with Immutable.js. When creating your store, make sure to import createForms, combineForms, modelReducer, and/or formReducer, etc. from react-redux-form/immutable.