universal-react icon indicating copy to clipboard operation
universal-react copied to clipboard

Redirect doesn't work

Open a-barbieri opened this issue 6 years ago • 1 comments

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;
}

a-barbieri avatar Jul 31 '18 14:07 a-barbieri

I've made a PR

a-barbieri avatar Jul 31 '18 14:07 a-barbieri