Hi,
Any alternative for RouterContext and match in react-router-dom?
I need to do something like below in express:
app.get('*', (req, res) => {
match(
{ routes:RoutesComponent, location: req.url },
(err, redirectLocation, renderProps) => {
let html;
if (renderProps) {
html= renderToString(<RouterContext {...renderProps}/>);
}
return res.render('index', { html});
}
);
});
Please read the docs before filing an issue: https://reacttraining.com/react-router/web/guides/server-rendering