I am using react router v 2.8.1 and am trying to set up my 404 page for my SPA. I am having trouble getting it to actually send back a 404. I am trying to do this so google will not index that page for me.
So far, I have tried setting a catch all route to get any unknown routes inside my Router -
<Router>
...
<Route
path='*'
status={404}
getComponent={(location, cb) => {
require.ensure([], require => {
const component = require('./components/404/component.jsx').default;
cb(null, component);
});
}}/>
</Router>
This works fine for showing the content. Via googling, I found some people using the status={404}, however I am not seeing it doing anything for me. Is there a way to force a 404 status back from react router (2.8.1)? Thanks!