supasate / connected-react-router

A Redux binding for React Router v4
MIT License
4.73k stars 593 forks source link

TypeScript: Error in history type #314

Open hazratgs opened 5 years ago

hazratgs commented 5 years ago

Hi, I have a cra project on typescript, added the connected-react-router to it, the first step:

`// reducers.js import { combineReducers } from 'redux' import { connectRouter } from 'connected-react-router'

export default (history) => combineReducers({ router: connectRouter(history), ... // rest of your reducers })`

After adding this code, an error occurs: Parameter 'history' implicitly has an 'any' type.

I do not really want to register any, please tell me which type to register there?

eordano commented 4 years ago

Hey there! First, npm i --save @types/history, and then try doing this:

import { History } from 'history'