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

ReactDOM.createRoot #11225

Merged
merged 2 commits into from
Oct 14, 2017
Merged

ReactDOM.createRoot #11225

merged 2 commits into from
Oct 14, 2017

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Oct 14, 2017

Introduce new API for creating roots. Only root.render and root.unmount are implemented. Later we'll add root.prerender, and support for lazy roots (roots with DOM containers that resolve lazily).

Introduce new API for creating roots. Only root.render and root.unmount
are implemented. Later we'll add root.prerender, and support for lazy
roots (roots with DOM containers that resolve lazily).
@acdlite acdlite force-pushed the createroot branch 3 times, most recently from eef374b to 3d91f47 Compare October 14, 2017 02:26
ReactRoot.prototype.unmount = function(callback) {
const root = this._reactRootContainer;
DOMRenderer.updateContainer(null, root, null, callback);
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is not a destroy method now? It's possible to render again after an unmount. With deterministic updates, is the motivation for the new API as strong?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, should probably throw? I'll address in a follow-up.

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

Successfully merging this pull request may close these issues.

3 participants