react-router-dom with TypeScript

前端 未结 7 580
清歌不尽
清歌不尽 2021-01-30 19:56

I\'m trying to use react router with TypeScript. However, I have certain problems using withRouter function. On the last line, I\'m getting pretty weird error:

A         


        
7条回答
  •  南方客
    南方客 (楼主)
    2021-01-30 20:59

    I think it is a typescript typings compilation issue, but I've found a workaround:

    interface HomeProps extends RouteComponentProps, React.Props {
    }
    

提交回复
热议问题