import { Link } from 'react-router-dom';
<Link to={"/app"}>
跳转 </Link>
在 index.js
里写可以跳转,在子组件里这样写就报错。如下
var href = this.context.router.history.createHref(typeof to === 'string' ? { pathname: to } : to);
这个应该怎么解决?
import { Link } from 'react-router-dom';
<Link to={"/app"}>
跳转 </Link>
在 index.js
里写可以跳转,在子组件里这样写就报错。如下
var href = this.context.router.history.createHref(typeof to === 'string' ? { pathname: to } : to);
这个应该怎么解决?