When Rakkas fails to match a URL with a page component, it will look for a
.tsx) file. For instance, when a request to
/foo/bar/baz is made and no page component matches, Rakkas will look for
/$404 in that order. This way, 404 pages can have the correct layout depending on the URL.
404 pages can have
preload functions just like normal pages. It's good practice to always have a root 404 page in
.tsx, Rakkas's default 404 page is very basic unstyled.
The difference between using a 404 page and a catch-all page with spread parameters, that is betweebn
/path/[...rest] is that 404 pages have lower priority. A catch-all page route will match before any API routes, but a 404 page will only match if no other route matches.
StyledLink component points to a non-existent page, Rakkas will do a full page reload before showing a 404 page just in case the URL is pointing to a non-page route like an API endpoint or a static file.