connected-react-router icon indicating copy to clipboard operation
connected-react-router copied to clipboard

typescript compatibility issue

Open yash2code opened this issue 6 years ago • 4 comments

When using it with typescript, it is giving error mentioned below:

Expected 2 arguments, but got 1.ts(2554) index.d.ts(60, 3): An argument for 'action' was not provided. (alias) connectRouter(history: History): Reducer<RouterState, LocationChangeAction> import connectRouter

for this code:

export default createStore( connectRouter(history)(rootReducer), initialState, composedEnhancers );

yash2code avatar Feb 11 '19 06:02 yash2code

This looks wrong - connectRouter produces a reducer function which should be combined with other reducers to become part of the rootReducer. Here you are trying to call it - since it’s a reducer, it is complaining about a missing action

flq avatar Feb 11 '19 21:02 flq

Confirmed, I am also running into this issue.

Alex1100 avatar Mar 25 '19 00:03 Alex1100

I ended up just ditching this and wrapping my App with <BrowserRouter>

Alex1100 avatar Mar 28 '19 16:03 Alex1100

I am having this issue, were any of you able to solve it?

jfsalaza avatar Sep 19 '19 00:09 jfsalaza