When using react-router-dom, should I be able to create a route and navigate to it by manually entering its path in the URL?
const App = () =>
<Provider store={store}>
<Router>
<div>
<Route exact path="/" component={QuotesLandingPage} />
<Route path="/prequote" component={LoadingSpinner} />
</div>
</Router>
</Provider>;
So, I will be on localhost, and when I manually type '/prequote
' to the end of the url
in the navbar
it doesn't redirect to the component I have specified, instead it throws a 404.
Is that expected behavior?
I have been searching for an answer and seen some suggestions that configuring webpack (I am using webpack) to have devServer.historyApiFallback = true
should work but it hasn't worked for me.