@@ -18,7 +18,6 @@ import {
18
18
REACT_MEMO_TYPE ,
19
19
REACT_PORTAL_TYPE ,
20
20
REACT_PROFILER_TYPE ,
21
- REACT_PROVIDER_TYPE ,
22
21
REACT_CONSUMER_TYPE ,
23
22
REACT_STRICT_MODE_TYPE ,
24
23
REACT_SUSPENSE_TYPE ,
@@ -30,7 +29,6 @@ import {
30
29
} from 'shared/ReactSymbols' ;
31
30
32
31
import {
33
- enableRenderableContext ,
34
32
enableScopeAPI ,
35
33
enableTransitionTracing ,
36
34
enableLegacyHidden ,
@@ -64,14 +62,7 @@ export function typeOf(object: any): mixed {
64
62
case REACT_MEMO_TYPE :
65
63
return $$typeofType ;
66
64
case REACT_CONSUMER_TYPE :
67
- if ( enableRenderableContext ) {
68
- return $$typeofType ;
69
- }
70
- // Fall through
71
- case REACT_PROVIDER_TYPE :
72
- if ( ! enableRenderableContext ) {
73
- return $$typeofType ;
74
- }
65
+ return $$typeofType ;
75
66
// Fall through
76
67
default :
77
68
return $$typeof ;
@@ -85,12 +76,8 @@ export function typeOf(object: any): mixed {
85
76
return undefined ;
86
77
}
87
78
88
- export const ContextConsumer : symbol = enableRenderableContext
89
- ? REACT_CONSUMER_TYPE
90
- : REACT_CONTEXT_TYPE ;
91
- export const ContextProvider : symbol = enableRenderableContext
92
- ? REACT_CONTEXT_TYPE
93
- : REACT_PROVIDER_TYPE ;
79
+ export const ContextConsumer : symbol = REACT_CONSUMER_TYPE ;
80
+ export const ContextProvider : symbol = REACT_CONTEXT_TYPE ;
94
81
export const Element = REACT_ELEMENT_TYPE ;
95
82
export const ForwardRef = REACT_FORWARD_REF_TYPE ;
96
83
export const Fragment = REACT_FRAGMENT_TYPE ;
@@ -127,8 +114,7 @@ export function isValidElementType(type: mixed): boolean {
127
114
type . $$typeof === REACT_LAZY_TYPE ||
128
115
type . $$typeof === REACT_MEMO_TYPE ||
129
116
type . $$typeof === REACT_CONTEXT_TYPE ||
130
- ( ! enableRenderableContext && type . $$typeof === REACT_PROVIDER_TYPE ) ||
131
- ( enableRenderableContext && type . $$typeof === REACT_CONSUMER_TYPE ) ||
117
+ type . $$typeof === REACT_CONSUMER_TYPE ||
132
118
type . $$typeof === REACT_FORWARD_REF_TYPE ||
133
119
// This needs to include all possible module reference object
134
120
// types supported by any Flight configuration anywhere since
@@ -145,18 +131,10 @@ export function isValidElementType(type: mixed): boolean {
145
131
}
146
132
147
133
export function isContextConsumer ( object : any ) : boolean {
148
- if ( enableRenderableContext ) {
149
- return typeOf ( object ) === REACT_CONSUMER_TYPE ;
150
- } else {
151
- return typeOf ( object ) === REACT_CONTEXT_TYPE ;
152
- }
134
+ return typeOf ( object ) === REACT_CONSUMER_TYPE ;
153
135
}
154
136
export function isContextProvider ( object : any ) : boolean {
155
- if ( enableRenderableContext ) {
156
- return typeOf ( object ) === REACT_CONTEXT_TYPE ;
157
- } else {
158
- return typeOf ( object ) === REACT_PROVIDER_TYPE ;
159
- }
137
+ return typeOf ( object ) === REACT_CONTEXT_TYPE ;
160
138
}
161
139
export function isElement ( object : any ) : boolean {
162
140
return (
0 commit comments