Search code snippets, questions, articles... Chrome Extension

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)
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool

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

Was this helpful?
0 Comments
Join Devsheet Ask a Question