how do you send http status code 404 in static react app if page does not exist?

Viewed 107

the static component Error doesnt show 404 status but 200

<BrowserRouter>
    <Switch>
        <Route exact path='/' component={Main} />
        <Route exact path='/contact' component={Contact}/>
        <Route exact path='/about' component={About}/>
        <Route component={Error} />
    </Switch>
</BrowserRouter>
0 Answers
Related