Route for error 500
How can I make a route for error 505 in solid start? I made a file
[...500].tsx
4 Replies
Also is there any chance to listen on DomContentLoadedEvent? I want to display Loading popup when the app is loading a route
Errors are handled by ErrorBoundaries
https://docs.solidjs.com/reference/components/error-boundary
regarding "loading while the app is loading a route" you may have a look at createAsync and Suspense
https://docs.solidjs.com/solid-router/reference/data-apis/create-async
Look at this example:
https://stackblitz.com/edit/github-xdufjx-hxnbnc?file=src%2Fcomponents%2Fglobal-loader.tsx
That component is used in the
src/app.tsx
and only becomes visible for:
- useIsRouting
- useTransitionpeerreynders
StackBlitz
Using a global loader for transitions - StackBlitz
solid-router's implicit transitions discourage page partial loading fallbacks in favour of paint-holding the stale page while showing one central loading indicator.
Thanks!