Using ReactJS frontend, with react-router, I somehow get an empty page when being redirected to a new route.
In a component I use the following to achieve a redirect:
if (this.props.showUnknownErrorPage) {
return <Redirect push to={`/${this.props.locale}/unforeseenerror/`}/>
}
This does lead to the correct URL:
http://127.0.0.1:8000/en/unforeseenerror/
But the page that shows is totally empty, just a blank page.
The route that should get the component to show:
<Route path={`${this.props.match.path}/unforeseenerror/`}
render={(props) => <UnknownErrorPage {...props}
setGreeneryAppState={this.setGreeneryAppState}/>}
/>
I have similar routes that look quite the same, and they work without problem. Can anyone help me debug this?
What I have already tried:
- Changed component content, to just an H1 element (no difference)
Changed to different route: a one line route like this:
<Route path={
${this.props.match.path}/about
} component={AboutPage}/>Tried a hardcoded route path
/en/unforeseenerror/
`