404 handling

When Rakkas fails to match a URL with a page component, it will look for a $404.page.jsx (or .tsx) file. For instance, when a request to / is made and no page component matches, Rakkas will look for /foo/bar/baz/$404, /foo/bar/$404, /foo/$404, and /$404 in that order. This way, 404 pages can have the correct layout depending on the URL.

404 pages can have action, headers, prerender, and preload functions just like normal pages. It's good practice to always have a root 404 page in src/routes/$404.page.jsx or .tsx, Rakkas's default 404 page is very basic unstyled.

If a Link or 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 static asset.