gabrielbull / react-router-server

Server Side Rendering library for React Router v4.
MIT License
434 stars 17 forks source link

renderToStaticMarkup #9

Closed ramboza closed 7 years ago

ramboza commented 7 years ago

Hello,

Great project! Thanks!

How can we render output with React.renderToStaticMarkup ?

gabrielbull commented 7 years ago

renderToStaticMarkup has not been implemented yet. It wouldn't be too long to implement it either because it could be a flag that gets pass to the renderPass function and decides wether to use renderToString or renderToStaticMarkup here: https://github.com/gabrielbull/react-router-server/blob/master/src/renderer/renderToString.js#L30

I'm a bit short on time this month to work on it but I'd gladly accept a PR. If you decide to make the changes, I think renderPass should be moved to its own file so that both renderToString and renderToStaticMarkup can use it.

gabrielbull commented 7 years ago

Added in newest release. Thanks for suggesting! 🎉