Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with the "dry run" render #8

Closed
bretthadley opened this issue Jul 27, 2018 · 1 comment
Closed

Issue with the "dry run" render #8

bretthadley opened this issue Jul 27, 2018 · 1 comment

Comments

@bretthadley
Copy link
Contributor

bretthadley commented Jul 27, 2018

Hi,

I guess I have a specific implementation issue but some people might also have similar issue. The frontloadServerRender() calls render twice (first to fill queues then second to get the output) this is causing an issue for me with react-jss SSR (the 2 renders are causing class name conflicts and they generated css from client / server is different because of this duplicate render)

Would it be possible to just pass a boolean to the callback?

frontloadServerRender((dryRun) => { return ReactDomServer.renderToString(....) })

https://github.com/davnicwil/react-frontload/blob/master/src/index.js#L206

render(true)

my personal use for this is here

http://cssinjs.org/react-jss/?v=v8.6.1#react-tree-traversing

#9

@davnicwil
Copy link
Owner

@bretthadley Thanks for the PR - it's been merged and a new version 1.0.2 has been published.

https://www.npmjs.com/package/react-frontload/v/1.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants