gajus / redux-immutable

redux-immutable is used to create an equivalent function of Redux combineReducers that works with Immutable.js state.
Other
1.88k stars 82 forks source link

React-router-redux selector documentation issue #53

Closed callumsteele4 closed 7 years ago

callumsteele4 commented 7 years ago

I was having trouble implementing redux-immutable with react-router-redux using the selector described in the README.md.

I would receive the following error:

Uncaught TypeError: Cannot read property 'charAt' of undefined
    at matchRoutes

I believe this is because the example is only converting the routing state shallowly, and can be fixed by using:

return state.get('routing').toJS()

instead of:

return state.get('routing').toObject()
gajus commented 7 years ago

@callumsteele4 can you confirm that toJS works?

callumsteele4 commented 7 years ago

Its working for me with this change.

gajus commented 7 years ago

Thank you, @callumsteele4