javascript

Add redux form reducer to store

To use the redux form in your react app you need to add the reducer provided by redux-form to your store. Now the store will be able to handle the actions that are coming from form components.

import { createStore, combineReducers } from 'redux'
import { reducer as rformReducer } from 'redux-form'

const rootReducer = combineReducers({
  form: rformReducer
})

const store = createStore(rootReducer)

The key name that is used to assign the redux-form reducer should be named form.

Was this helpful?