markdalgleish / react-to-html-webpack-plugin

Webpack plugin that renders React components to HTML files
MIT License
168 stars 14 forks source link

Usage with react-router? #5

Open idolize opened 9 years ago

idolize commented 9 years ago

How would one go about using this with react-router?

Since there is a requirement to export a single component, and react-router requires the React.renderToString to be called in a callback it looks like the two are incompatible (because we don't have the actual component to export yet by the end of the first synchronous evaluation of the file).

Perhaps the file could export a React component or a Promise which returns a React component?