mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 00:20:04 +01:00
Portals trigger Suspense boundaries in SSR and only render on client
This commit is contained in:
parent
64f636b437
commit
9b78e66d94
|
|
@ -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.',
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user