You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a validation service outside the component that navigates and redirects when it encounters a 401 error. However, I cannot access it outside the component.
import{AuthContextProvider}from"./contexts/auth/auth.context";constApp=()=>{constnavigate=useNavigate();// ← Error: <A> and 'use' router primitives can be only used inside a Route.constservice=newLocalAuthService(navigate);return(<divclass="bg-background relative flex min-h-svh flex-col"><ThemeProvider><AuthContextProviderinstance={service}><I18nProviderloadResources={(locale)=>import(`./assets/locales/${locale}.ts`).then((res)=>res.default)}><SidebarProvider><UserProvider><Router>{routes}</Router></UserProvider></SidebarProvider></I18nProvider></AuthContextProvider></ThemeProvider></div>);};
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
https://stackblitz.com/edit/solidjs-templates-t5zefbwm?file=src%2FApp.tsx
I have a validation service outside the component that navigates and redirects when it encounters a 401 error. However, I cannot access it outside the component.
Beta Was this translation helpful? Give feedback.
All reactions