How to correctly set up 404 page, so that if user hits any route that does not exist, it redirects to this 404 page?
Currently I have this code:
import React from "react";
import Layout from "../components/layout";
import SEO from "../components/seo";
const NotFoundPage = () => (
<Layout>
<SEO title="404: Not found" />
<h1>NOT FOUND</h1>
<p>You just hit a route that doesn't exist... the sadness.</p>
</Layout>
);
export default NotFoundPage;