StrikeForceZero / react-typescript-boilerplate

:fire: A highly scalable, offline-first foundation with the best developer experience and a focus on performance and best practices. (typescript)
http://reactboilerplate.com
MIT License
54 stars 9 forks source link

Problems using redux-form #13

Open affemaen opened 7 years ago

affemaen commented 7 years ago

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

StrikeForceZero commented 7 years ago

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

affemaen commented 7 years ago

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.

StrikeForceZero commented 7 years ago

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

affemaen commented 7 years ago

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.