react-typescript-boilerplate icon indicating copy to clipboard operation
react-typescript-boilerplate copied to clipboard

Problems using redux-form

Open affemaen opened this issue 8 years ago • 4 comments

I'm having problems adding redux-form(redux-form": "6.7.0") as a reducer. Tried it on react-boilerplate which the boilerplate is forked from and it works fine.

after adding

+import { reducer as form } from 'redux-form/immutable';
return combineReducers({
export default function createReducer(asyncReducers: Redux.ReducersMapObject = {}): Redux.Reducer<any> {
  const reducers = {
    route: routeReducer,
    global: globalReducer,
    language: languageProviderReducer,
    + form
    ...asyncReducers,
  };

  return combineReducers(reducers);
}

to reducers.ts

The error I'm getting screen shot 2017-05-17 at 14 39 38

I've tried removing the react-hot-loader and different versions of redux-immutable

affemaen avatar May 17 '17 13:05 affemaen

Your snippet has some syntax issues

+import
+ form
return combineReducers({ export default

If you have an example repo I could take a look at that

StrikeForceZero avatar May 17 '17 19:05 StrikeForceZero

My bad, it was supposed to look like a git diff.

Added an example repo https://github.com/affemaen/react-typescript-boilerplate

It combines the form reducer.

affemaen avatar May 18 '17 07:05 affemaen

Did you still need assistance with this? I should have time this weekend to look it over

StrikeForceZero avatar May 27 '17 08:05 StrikeForceZero

Managed a workaround by setting and alias for immutable so that redux-form uses the correct import of immutable.

Seems to be issues with not using the latest version of react-hot-loader. Have to export the form as a prop for a workaround. I don't have access to the code at the moment but I'll post an example later if more people are having problems.

affemaen avatar May 27 '17 08:05 affemaen