Closed oojacoboo closed 8 years ago
The main export is just a function which takes any callback.
import { match } from 'react-router';
module.exports = (path, props, callback) => {
html = '';
match({ routes, location: path, basename: '/' }, (err, redirectLocation, renderProps) => {
html = ReactDOMServer.renderToString(
<RouterContext {...renderProps}>{routes}</RouterContext>
);
});
callback(html);
};
Thanks yea, I actually came up with something quite similar to this.
Any docs on how to implement with the new API changes on react-router 2.x?