Dec 9, 2020
Paul George when you enter an invalid route, It will first go to the server, If there is a matching route available, then the server will handle that, If there is no matching route, then React will handle that and your React 404 page will be displayed.
This is because we have added the following code inside server/index.js
file.
app.use((req, res, next) => {
res.sendFile(path.join(__dirname, "..", "build", "index.html"));
});