import { useRouter } from 'next/router'; 在非hooks 文件或组件中使用
发布时间 2023-10-19 10:26:57作者: 龙卷风吹毁停车场
将 import { useRouter } from 'next/router'; 改为 import Router from "next/router";
使用: Router.push('/');
原来使用 import { useRouter } from 'next/router'; 会导致报错如下