@@ -1816,6 +1816,7 @@ function dispatchAction<S, A>(
18161816}
18171817
18181818export const ContextOnlyDispatcher : Dispatcher = {
1819+ readCache : readContext , // TODO
18191820 readContext ,
18201821
18211822 useCallback : throwInvalidHookError ,
@@ -1837,6 +1838,7 @@ export const ContextOnlyDispatcher: Dispatcher = {
18371838} ;
18381839
18391840const HooksDispatcherOnMount: Dispatcher = {
1841+ readCache : readContext , // TODO
18401842 readContext ,
18411843
18421844 useCallback : mountCallback ,
@@ -1858,6 +1860,7 @@ const HooksDispatcherOnMount: Dispatcher = {
18581860} ;
18591861
18601862const HooksDispatcherOnUpdate: Dispatcher = {
1863+ readCache : readContext , // TODO
18611864 readContext ,
18621865
18631866 useCallback : updateCallback ,
@@ -1879,6 +1882,7 @@ const HooksDispatcherOnUpdate: Dispatcher = {
18791882} ;
18801883
18811884const HooksDispatcherOnRerender: Dispatcher = {
1885+ readCache : readContext , // TODO
18821886 readContext ,
18831887
18841888 useCallback : updateCallback ,
@@ -1927,6 +1931,14 @@ if (__DEV__) {
19271931 } ;
19281932
19291933 HooksDispatcherOnMountInDEV = {
1934+ // TODO: remove the arguments and change the implementation.
1935+ readCache< T > (
1936+ context : ReactContext < T > ,
1937+ observedBits : void | number | boolean ,
1938+ ) : T {
1939+ warnInvalidContextAccess ( ) ;
1940+ return readContext ( context , observedBits ) ;
1941+ } ,
19301942 readContext < T > (
19311943 context : ReactContext < T > ,
19321944 observedBits : void | number | boolean ,
@@ -2054,6 +2066,14 @@ if (__DEV__) {
20542066 } ;
20552067
20562068 HooksDispatcherOnMountWithHookTypesInDEV = {
2069+ // TODO: remove the arguments and change the implementation.
2070+ readCache < T > (
2071+ context : ReactContext < T > ,
2072+ observedBits : void | number | boolean ,
2073+ ) : T {
2074+ warnInvalidContextAccess ( ) ;
2075+ return readContext ( context , observedBits ) ;
2076+ } ,
20572077 readContext < T > (
20582078 context : ReactContext < T > ,
20592079 observedBits : void | number | boolean ,
@@ -2176,6 +2196,14 @@ if (__DEV__) {
21762196 } ;
21772197
21782198 HooksDispatcherOnUpdateInDEV = {
2199+ // TODO: remove the arguments and change the implementation.
2200+ readCache < T > (
2201+ context : ReactContext < T > ,
2202+ observedBits : void | number | boolean ,
2203+ ) : T {
2204+ warnInvalidContextAccess ( ) ;
2205+ return readContext ( context , observedBits ) ;
2206+ } ,
21792207 readContext < T > (
21802208 context : ReactContext < T > ,
21812209 observedBits : void | number | boolean ,
@@ -2298,6 +2326,14 @@ if (__DEV__) {
22982326 } ;
22992327
23002328 HooksDispatcherOnRerenderInDEV = {
2329+ // TODO: remove the arguments and change the implementation.
2330+ readCache < T > (
2331+ context : ReactContext < T > ,
2332+ observedBits : void | number | boolean ,
2333+ ) : T {
2334+ warnInvalidContextAccess ( ) ;
2335+ return readContext ( context , observedBits ) ;
2336+ } ,
23012337 readContext < T > (
23022338 context : ReactContext < T > ,
23032339 observedBits : void | number | boolean ,
@@ -2421,6 +2457,13 @@ if (__DEV__) {
24212457 } ;
24222458
24232459 InvalidNestedHooksDispatcherOnMountInDEV = {
2460+ readCache < T > (
2461+ // TODO: remove this argument.
2462+ context : ReactContext < T > ,
2463+ observedBits : void | number | boolean ,
2464+ ) : T {
2465+ return readContext ( context , observedBits ) ;
2466+ } ,
24242467 readContext < T > (
24252468 context : ReactContext < T > ,
24262469 observedBits : void | number | boolean ,
@@ -2558,6 +2601,14 @@ if (__DEV__) {
25582601 } ;
25592602
25602603 InvalidNestedHooksDispatcherOnUpdateInDEV = {
2604+ // TODO: remove the arguments and change the implementation.
2605+ readCache < T > (
2606+ context : ReactContext < T > ,
2607+ observedBits : void | number | boolean ,
2608+ ) : T {
2609+ warnInvalidContextAccess ( ) ;
2610+ return readContext ( context , observedBits ) ;
2611+ } ,
25612612 readContext < T > (
25622613 context : ReactContext < T > ,
25632614 observedBits : void | number | boolean ,
@@ -2695,6 +2746,14 @@ if (__DEV__) {
26952746 } ;
26962747
26972748 InvalidNestedHooksDispatcherOnRerenderInDEV = {
2749+ // TODO: remove the arguments and change the implementation.
2750+ readCache < T > (
2751+ context : ReactContext < T > ,
2752+ observedBits : void | number | boolean ,
2753+ ) : T {
2754+ warnInvalidContextAccess ( ) ;
2755+ return readContext ( context , observedBits ) ;
2756+ } ,
26982757 readContext < T > (
26992758 context : ReactContext < T > ,
27002759 observedBits : void | number | boolean ,
0 commit comments