coco
coco
SSolidJS
Created by coco on 12/21/2024 in #support
Passing signals as props in a Route component
awesome it worked ! thank you so much ! I ended up doing this
<Route component={(props) => <ProtectedRoutes isAuthenticated={isAuthenticated} setIsAuthenticated={setIsAuthenticated} children={props.children}/>}>
<Route path="/" component={Home} />
<Route path="/some-route" component={SomeRoute} />
<Route path="/some-other-route" component={SomeOtherRoute} />
</Route>
<Route component={(props) => <ProtectedRoutes isAuthenticated={isAuthenticated} setIsAuthenticated={setIsAuthenticated} children={props.children}/>}>
<Route path="/" component={Home} />
<Route path="/some-route" component={SomeRoute} />
<Route path="/some-other-route" component={SomeOtherRoute} />
</Route>
5 replies
SSolidJS
Created by coco on 12/21/2024 in #support
Passing signals as props in a Route component
yes that's my current implementation but I can't retrieve sub routes that way and render it with props.children (in ProtectedRoutes)
5 replies