@@ -1711,6 +1711,15 @@ function createChildReconciler(shouldTrackSideEffects) {
1711
1711
) ;
1712
1712
if ( "function" === typeof newChild . then )
1713
1713
return createChild ( returnFiber , unwrapThenable ( newChild ) , lanes ) ;
1714
+ if (
1715
+ newChild . $$typeof === REACT_CONTEXT_TYPE ||
1716
+ newChild . $$typeof === REACT_SERVER_CONTEXT_TYPE
1717
+ )
1718
+ return createChild (
1719
+ returnFiber ,
1720
+ readContextDuringReconcilation ( returnFiber , newChild , lanes ) ,
1721
+ lanes
1722
+ ) ;
1714
1723
throwOnInvalidObjectType ( returnFiber , newChild ) ;
1715
1724
}
1716
1725
return null ;
@@ -1751,6 +1760,16 @@ function createChildReconciler(shouldTrackSideEffects) {
1751
1760
unwrapThenable ( newChild ) ,
1752
1761
lanes
1753
1762
) ;
1763
+ if (
1764
+ newChild . $$typeof === REACT_CONTEXT_TYPE ||
1765
+ newChild . $$typeof === REACT_SERVER_CONTEXT_TYPE
1766
+ )
1767
+ return updateSlot (
1768
+ returnFiber ,
1769
+ oldFiber ,
1770
+ readContextDuringReconcilation ( returnFiber , newChild , lanes ) ,
1771
+ lanes
1772
+ ) ;
1754
1773
throwOnInvalidObjectType ( returnFiber , newChild ) ;
1755
1774
}
1756
1775
return null ;
@@ -1811,6 +1830,17 @@ function createChildReconciler(shouldTrackSideEffects) {
1811
1830
unwrapThenable ( newChild ) ,
1812
1831
lanes
1813
1832
) ;
1833
+ if (
1834
+ newChild . $$typeof === REACT_CONTEXT_TYPE ||
1835
+ newChild . $$typeof === REACT_SERVER_CONTEXT_TYPE
1836
+ )
1837
+ return updateFromMap (
1838
+ existingChildren ,
1839
+ returnFiber ,
1840
+ newIdx ,
1841
+ readContextDuringReconcilation ( returnFiber , newChild , lanes ) ,
1842
+ lanes
1843
+ ) ;
1814
1844
throwOnInvalidObjectType ( returnFiber , newChild ) ;
1815
1845
}
1816
1846
return null ;
@@ -2131,6 +2161,16 @@ function createChildReconciler(shouldTrackSideEffects) {
2131
2161
unwrapThenable ( newChild ) ,
2132
2162
lanes
2133
2163
) ;
2164
+ if (
2165
+ newChild . $$typeof === REACT_CONTEXT_TYPE ||
2166
+ newChild . $$typeof === REACT_SERVER_CONTEXT_TYPE
2167
+ )
2168
+ return reconcileChildFibersImpl (
2169
+ returnFiber ,
2170
+ currentFirstChild ,
2171
+ readContextDuringReconcilation ( returnFiber , newChild , lanes ) ,
2172
+ lanes
2173
+ ) ;
2134
2174
throwOnInvalidObjectType ( returnFiber , newChild ) ;
2135
2175
}
2136
2176
return ( "string" === typeof newChild && "" !== newChild ) ||
@@ -5037,20 +5077,24 @@ function prepareToReadContext(workInProgress, renderLanes) {
5037
5077
( workInProgress . firstContext = null ) ) ) ;
5038
5078
}
5039
5079
function readContext ( context ) {
5080
+ return readContextForConsumer ( currentlyRenderingFiber , context ) ;
5081
+ }
5082
+ function readContextDuringReconcilation ( consumer , context , renderLanes ) {
5083
+ null === currentlyRenderingFiber &&
5084
+ prepareToReadContext ( consumer , renderLanes ) ;
5085
+ return readContextForConsumer ( consumer , context ) ;
5086
+ }
5087
+ function readContextForConsumer ( consumer , context ) {
5040
5088
var value = context . _currentValue2 ;
5041
5089
if ( lastFullyObservedContext !== context )
5042
5090
if (
5043
5091
( ( context = { context : context , memoizedValue : value , next : null } ) ,
5044
5092
null === lastContextDependency )
5045
5093
) {
5046
- if ( null === currentlyRenderingFiber )
5047
- throw Error ( formatProdErrorMessage ( 308 ) ) ;
5094
+ if ( null === consumer ) throw Error ( formatProdErrorMessage ( 308 ) ) ;
5048
5095
lastContextDependency = context ;
5049
- currentlyRenderingFiber . dependencies = {
5050
- lanes : 0 ,
5051
- firstContext : context
5052
- } ;
5053
- enableLazyContextPropagation && ( currentlyRenderingFiber . flags |= 524288 ) ;
5096
+ consumer . dependencies = { lanes : 0 , firstContext : context } ;
5097
+ enableLazyContextPropagation && ( consumer . flags |= 524288 ) ;
5054
5098
} else lastContextDependency = lastContextDependency . next = context ;
5055
5099
return value ;
5056
5100
}
@@ -9846,7 +9890,7 @@ var slice = Array.prototype.slice,
9846
9890
return null ;
9847
9891
} ,
9848
9892
bundleType : 0 ,
9849
- version : "18.3.0-www-classic-812a2cd2 " ,
9893
+ version : "18.3.0-www-classic-92b5c33e " ,
9850
9894
rendererPackageName : "react-art"
9851
9895
} ;
9852
9896
var internals$jscomp$inline_1303 = {
@@ -9877,7 +9921,7 @@ var internals$jscomp$inline_1303 = {
9877
9921
scheduleRoot : null ,
9878
9922
setRefreshHandler : null ,
9879
9923
getCurrentFiber : null ,
9880
- reconcilerVersion : "18.3.0-www-classic-812a2cd2 "
9924
+ reconcilerVersion : "18.3.0-www-classic-92b5c33e "
9881
9925
} ;
9882
9926
if ( "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ ) {
9883
9927
var hook$jscomp$inline_1304 = __REACT_DEVTOOLS_GLOBAL_HOOK__ ;
0 commit comments