universal-react
universal-react copied to clipboard
Redirect doesn't work
Hi,
the current configuration of server/index.js
doesn't handle redirection in the correct way.
For example, if you try to add <Redirect from="/favourite-playlist" to="/playlists/pl-funk" />
among the available routes the client side will render the redirect properly, whereas the server side will not react to the redirect showing an empty page.
If you debug the code, renderToNodeStream(appWithRouter)
at line 57 isn't rendering anything.
My guess is that this lines are in the wrong place:
if (context.url) {
res.redirect(context.url);
return;
}
I've made a PR