Hi.
I’m not using root /
route so I added a route that redirects from root /
to /dashboard
<Router useAuth={useAuth}>
<Private unauthenticated="login">
<Set wrap={MainLayout}>
<Route path="/dashboard" page={DashboardPage} name="dashboard" />
</Set>
</Private>
<Route path="/login" page={LoginPage} name="login" />
<Route path="/" redirect="/dashboard" />
<Route notfound page={NotFoundPage} />
</Router>
It works but I’m getting a warning
gen | Warning: 2 duplicate routes have been detected, only the route(s) closest to the top of the file will be used.
gen | -> Name: "undefined", Path: "/", Page: "undefined"
gen | -> Name: "undefined", Path: "undefined", Page: "NotFoundPage"
As I understand that happens because redirect route and notfound route both have
name
property of undefined
.
How to redirect from splash screen and not get warnings?