我是NodeJS的新手,当我像在react应用程序中一样将路由添加到app.tsx文件时,我正在使用这个模板vite-typescript-ssr-react。
import React from "react";
import { Routes, Route } from "react-router-dom";
import AuthPage from "./pages/AuthPage.tsx";
import DashboardPage from "./pages/DashboardPage.tsx";
import { ContextWrapper } from "./context/Context.tsx";
export const App = () => {
return (
<ContextWrapper>
<Routes>
<Route path="/auth" element={<AuthPage />} />
<Route path="/dashboard" element={<DashboardPage />} />
</Routes>
</ContextWrapper>
);
};
export default App;
字符串
我得到以下错误:
app | No routes matched location "/"
app | No routes matched location "/tailwindcss/components"
app | No routes matched location "/tailwindcss/utilities"
app | No routes matched location "/tailwindcss/base"
app | No routes matched location "/favicon.ico"
型
我不知道我在这里做错了什么……
1条答案
按热度按时间wvmv3b1j1#
我不知道发生了什么,但错误已经消失了。
我的意思是我确实改变了路由器,但我不知道是什么造成的差异。
这是我的新方法,首先是路由文件,
字符串
这是路由器:
型