Skip to content

Make ReactDOM.createPortal() official#10675

Merged
gaearon merged 2 commits into
react:masterfrom
gaearon:portal-stuff
Sep 11, 2017
Merged

Make ReactDOM.createPortal() official#10675
gaearon merged 2 commits into
react:masterfrom
gaearon:portal-stuff

Conversation

@gaearon

@gaearon gaearon commented Sep 11, 2017

Copy link
Copy Markdown
Collaborator

We might later want to move portal creation to React API that would be renderer-agnostic and work across renderers but it's likely that it will be a superset of the current API.

So we might as well call the current API "stable". Especially because it's the only migration path for top-level render returning null inside a batch in 16.

See individual commits. I added validation because otherwise you get a very confusing error when you pass something else. Also helps us make it clear it's currently not supported by SSR.

Open question: what happens if you do {isClient && ReactDOM.createPortal(...)}? Does it cause a mismatch on initial render? I don't know. Worth checking.

@gaearon gaearon added this to the 16.0 milestone Sep 11, 2017
@gaearon gaearon merged commit 89508f2 into react:master Sep 11, 2017
@gaearon gaearon deleted the portal-stuff branch September 11, 2017 21:24
@koba04 koba04 mentioned this pull request Sep 12, 2017
@thysultan thysultan mentioned this pull request Sep 12, 2017
@ntucker

ntucker commented Sep 13, 2017

Copy link
Copy Markdown

Is there documentation on this anywhere?

@gaearon

gaearon commented Sep 13, 2017

Copy link
Copy Markdown
Collaborator Author

There will be. :-)

@Nantris

Nantris commented Sep 24, 2017

Copy link
Copy Markdown

@gaearon Do you have a rough idea of when the documentation will be available? A week? A month?

Thanks very much!

@gaearon

gaearon commented Sep 24, 2017

Copy link
Copy Markdown
Collaborator Author

Together with React 16, in a few days. We provide documentation for new features at the same time they are released.

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.

5 participants