mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Portals trigger Suspense boundaries in SSR and only render on client
This commit is contained in:
1 parent
64f636b437
commit
9b78e66d94
1 file changed
+1
-2
+1
-2
@@ -975,13 +975,12 @@ class ReactDOMServerRenderer {
|
||||
if (nextChild != null && nextChild.$$typeof != null) {
|
||||
// Catch unexpected special types early.
|
||||
const $$typeof = nextChild.$$typeof;
|
||||
// LUNA
|
||||
if ($$typeof === REACT_PORTAL_TYPE) {
|
||||
if (enableSuspenseServerRenderer) {
|
||||
throw $$typeof;
|
||||
} else {
|
||||
invariant(
|
||||
$$typeof !== REACT_PORTAL_TYPE,
|
||||
false,
|
||||
'Portals are not currently supported by the server renderer. ' +
|
||||
'Render them conditionally so that they only appear on the client render.',
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user