Nextjs路由器-登录后重定向到先前的请求页面

时间:2019-09-14 04:51:27

标签: reactjs react-router next.js

最近要迁移到nextjs,并且必须移植从react-router到next-router的所有内容。 我找不到的一个文档是如何获取previousPathName并重定向到该页面。

基本上是下一个路由器的对应版本:

 let { previousPathName } = this.state;
 this.props.history.push(previousPathName);

0 个答案:

没有答案