The antd page reports an error TypeError: Cannot read property'push' of undefined

Using antd, an error is reported when traversing the redirected url as shown in the figure

 

 

import {withRouter} from 'react-router-dom'
...
...

export default withRouter(Index);

Use withRouter to solve successfully

Guess you like

Origin blog.csdn.net/chendongpu/article/details/112133130