import { useRouter } from 'next/router'; 在非hooks 文件或组件中使用

将 import { useRouter } from 'next/router'; 改为 import Router from "next/router";
使用: Router.push('/');
原来使用 import { useRouter } from 'next/router'; 会导致报错如下

 

 

posted @ 2023-10-19 10:13  龙卷风吹毁停车场  阅读(112)  评论(0)    收藏  举报