I'm looking to have a redirect for every link that aren't specified in the configuration of my react app. The small difference with other tutorial is that I want to redirect to an html page which is present in my public folder and not a react component.
Something like this:
<Switch>
<Route exact path="/" component={component}/>
<Redirect to="/404.html"/>
</Switch>
but it creates an infinite loop if I enter anything else than mysite/ and mysite/404.html. If i type mysite/aaaaaaaaaaaaaaaaa
it returns the following error : Maximum update depth exceeded
Any idea why it happens and how I can solve it ?