Skip to content

🐛 Use ReactDOM.render instead of hydrate when prerender is falsy #844

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

Merged
merged 1 commit into from
Nov 27, 2017

Conversation

jsbaltodano
Copy link
Contributor

Allow react-rails to use ReactDOM.render in components created whose value for prerender is falsy (false, nil).

Summary

React gives a warning when a not pre-rendered component is not rendered using ReactDOM.render()
Following advise from #842
A new html option has been added to use between the ReactDOM methods render() or hydrate().

render()
prerender not set or set to a falsy value

hydrate()
truthy value and not :static

Allow react-rails to use ReactDOM.render in components created whose value for prerender is falsy (false, nil).
@BookOfGreg
Copy link
Member

This is excellent, thanks for the contribution!
I'll make a small tweak to the changelog to reference the issue and this PR and add a ruby test for the new data attr after I merge this. Great help! 😁

@BookOfGreg BookOfGreg merged commit f02a3af into reactjs:master Nov 27, 2017
BookOfGreg added a commit that referenced this pull request Nov 27, 2017
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

Successfully merging this pull request may close these issues.

2 participants