redux + TypeScript encountered an error occurs introduced withRouter

When redux + TypeScript project, using withRouter time, reported the following error, no property under the prop withRouter brought not the type to determine the reasons for

Solution: make your own interface inheritance can RouteComponentProps 

import {RouteComponentProps, withRouter} from "react-router"

interface Props_types extends RouteComponentProps{
}

class Tabs extends React.Component<Props_types, State_types> {
}

 

Guess you like

Origin blog.csdn.net/Dilomen/article/details/94744611