Custom ProtectedRoutes component does not render elements on URL match
I've created a custom component
here is a minimal version: https://stackblitz.com/edit/solidjs-templates-gkkfyr?file=src%2FApp.tsx
ProtectedRoutes
which is rendered within App.tsx
. The purpose is to check the URL that the user is viewing, allow or deny based on store.user.isAuthenticated
variable.
There are also two sub-components for ProtectedRoutes
.
One is AllowAuthenticated
:
And similarly, the other is DenyAuthenticated
which redirects the user to a default URL for authenticated users.
Here's what the ProtectedRoutes
component looks like:
For some reason, when URL is /
or any of the children paths /dashboard
, /profile
- their contents are not rendered on the page.
However, not using Allow/DenyAuthenticated
elements, then the pages are rendered as expected.
What might be the issue here?here is a minimal version: https://stackblitz.com/edit/solidjs-templates-gkkfyr?file=src%2FApp.tsx
0 Replies