mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Portals trigger Suspense boundaries in SSR and only render on client
This commit is contained in:
+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