@@ -94,12 +94,14 @@ import {
94
94
REACT_MEMO_TYPE ,
95
95
REACT_PROVIDER_TYPE ,
96
96
REACT_CONTEXT_TYPE ,
97
+ REACT_SCOPE_TYPE ,
97
98
} from 'shared/ReactSymbols' ;
98
99
import ReactSharedInternals from 'shared/ReactSharedInternals' ;
99
100
import {
100
101
disableLegacyContext ,
101
102
disableModulePatternComponents ,
102
103
warnAboutDefaultPropsOnFunctionComponents ,
104
+ enableScopeAPI ,
103
105
} from 'shared/ReactFeatureFlags' ;
104
106
105
107
import getComponentNameFromType from 'shared/getComponentNameFromType' ;
@@ -890,6 +892,14 @@ function renderElement(
890
892
renderNodeDestructive ( request , task , props . children ) ;
891
893
return ;
892
894
}
895
+ case REACT_SCOPE_TYPE : {
896
+ if ( enableScopeAPI ) {
897
+ renderNodeDestructive ( request , task , props . children ) ;
898
+ return ;
899
+ }
900
+ invariant ( false , 'ReactDOMServer does not yet support scope components.' ) ;
901
+ }
902
+ // eslint-disable-next-line-no-fallthrough
893
903
case REACT_SUSPENSE_TYPE : {
894
904
renderSuspenseBoundary ( request , task , props ) ;
895
905
return ;
@@ -988,7 +998,12 @@ function renderNodeDestructive(
988
998
return ;
989
999
}
990
1000
case REACT_PORTAL_TYPE :
991
- throw new Error ( 'Not yet implemented node type.' ) ;
1001
+ invariant (
1002
+ false ,
1003
+ 'Portals are not currently supported by the server renderer. ' +
1004
+ 'Render them conditionally so that they only appear on the client render.' ,
1005
+ ) ;
1006
+ // eslint-disable-next-line-no-fallthrough
992
1007
case REACT_LAZY_TYPE :
993
1008
throw new Error ( 'Not yet implemented node type.' ) ;
994
1009
}
0 commit comments