S
SolidJS14mo ago
dafuq

Make sure your app is wrapped in a <Router />

Hey folks, probably something silly but why can't I access useNavigator in my RouteGuard? Attaching my RouteGuard and App.tsx 🙏
No description
No description
4 Replies
Birk Skyum
Birk Skyum14mo ago
what version of the solid router is this?
dafuq
dafuqOP14mo ago
"@solidjs/router": "^0.10.10" Is there some sort of breaking change? I know there's no <Routes /> in this.
Brendonovich
Brendonovich14mo ago
@Benny Routers should only have <Route/> elements as their children. To make guard routes you’ll need to add a path-less route containing the layout component
dafuq
dafuqOP14mo ago
That was it, thanks @Brendonovich ❤️

Did you find this page helpful?