Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Document legacyness of the return value of ReactDOM.render() #6400
referenced this pull request
Apr 6, 2016
Apr 7, 2016
1 check passed
added a commit
this pull request
Apr 7, 2016
This should probably be considered along with ReactDOM.renderToString and ReactDOM.renderToStaticMarkup. Would those necessarily not be able to synchronously return the string markup too (assuming an async render is allowed)?
If that is true, then would they return a promise, observable, or use a new cb parameter to obtain the html?
So whatever is decided for those, maybe a similar mechanism should be allowed for ReactDOM.render for symmetry. Meaning if renderToString and renderToStaticMarkup both return a promise which eventually resolves to the html, maybe render should return a promise which eventually resolves to the component. Likewise if observable or cb mechanism is chosen. This is an alternative to using the ref cb.
It is nice to have symmetry as much as possible in these api's. Developers have enough other things to worry about.