代码如下:importReact,{Component}from'react';importReactDOMfrom'react-dom';import'./index.css';importregisterServiceWorkerfrom'./registerServiceWorker';import'./App.css';importHeaderfrom'./header';importMainfrom'./main';importFooterfrom'./footer';importLoginfrom'./login/index'import{HashRouterasRouter,Route,hashHistory,Switch}from'react-router';import{Provider}from'react-redux'importstorefrom'./store'constHome=()=>(Home)constChat=()=>()constLoginPage=()=>()classAppextendsComponent{render(){**this.props.history.push('/chat')**console.log(hashHistory)return()}}想通过render中执行切换路由this.props.history.push('/chat')报错:TypeError:Cannotreadproperty'push'ofundefined,不知道怎么办了,求解答
添加回答
举报
0/150
提交
取消