I am using react-router-dom and I experience a weird behavior when redirecting. I'm trying to redirect from / to /something. So I used:
<Switch>
<Redirect
exact
from='/'
to='/something'
/>
<Route
component={Garden}
exact
path='/something'
/>
</Switch>
When I open localhost:3000/ I get redirected to localhost:3000/something but the page is blank. When I refresh the page or access /something directly, the page is displayed as expected.
A similar behavior happens when I use react-router-hash-link to handle anchor tags. When setting the scrolling to smooth scroll, I can see the page smoothly scrolling but as soon as it reaches the tag, the page becomes blank. For it to work, I need to refresh the page which is quite inconvenient.
thank you,