方法1
在根目录上添加一个errorElement
{
path: '/',
element: <Navigate to="/public/index" replace />,
errorElement: <div>errorPage</div>
},
方法2
{
path: '*',
element: <div>errorPage</div>,
}
标签:errorElement,element,react,全栈,404,errorPage,根目录,path
From: https://blog.csdn.net/2401_82752568/article/details/137440643