Ok so I am working on making a 404 page for react but I don't know how to implement it properly this is what my code looks like
<Router>
<Switch>
<main className={`app ${isDark ? 'app--dark' : ''}`}>
<ProtectedRoute
path="/conversations"
component={() => (
<Home colorMode={isDark} toggleColorMode={toggleColorMode} />
)}
/>
<Route path="/login" component={LoginPage} />
<Route path="/devnotes" component={Devnotes} />
<ProtectedRoute path="/userinfo" component={UserInfo} />
<ProtectedRoute
path="/settings"
component={() => (
<Setting colorMode={isDark} toggleColorMode={toggleColorMode} />
)}
/>
<ProtectedRoute
path="/developerhub"
component={() => (
<Developerhub
className="devhub"
colorMode={isDark}
toggleColorMode={toggleColorMode}
/>
)}
/>
<Redirect to="/conversations" />
<Route path="*">
<FourOhFour />
</Route>
</main>
</Switch>
</Router>;
I watched quite a bit of youtube videos on how to do it and they all said for the path to be *, which is fine but I also don't want the 404 page showing up on all pages I just want it to show up on the ones that don't exist. Does anyone have a solution to this?