11// @flow
22
33import type { Node } from 'react'
4- import * as is from 'react-is'
4+
5+ let Element = 0xeac7
6+ let Portal = 0xeaca
7+ let Fragment = 0xeacb
8+ let StrictMode = 0xeacc
9+ let Profiler = 0xead2
10+ let ContextProvider = 0xeacd
11+ let ContextConsumer = 0xeace
12+ let ConcurrentMode = 0xeacf
13+ let ForwardRef = 0xead0
14+ let Suspense = 0xead1
15+ let Memo = 0xead3
16+ let Lazy = 0xead4
17+
18+ if ( typeof Symbol === 'function' && Symbol . for ) {
19+ const symbolFor = Symbol . for
20+ Element = symbolFor ( 'react.element' )
21+ Portal = symbolFor ( 'react.portal' )
22+ Fragment = symbolFor ( 'react.fragment' )
23+ StrictMode = symbolFor ( 'react.strict_mode' )
24+ Profiler = symbolFor ( 'react.profiler' )
25+ ContextProvider = symbolFor ( 'react.provider' )
26+ ContextConsumer = symbolFor ( 'react.context' )
27+ ConcurrentMode = Symbol . for ( 'react.concurrent_mode' )
28+ ForwardRef = symbolFor ( 'react.forward_ref' )
29+ Suspense = symbolFor ( 'react.suspense' )
30+ Memo = symbolFor ( 'react.memo' )
31+ Lazy = symbolFor ( 'react.lazy' )
32+ }
533
634/** Literal types representing the ReactSymbol values. These values do not actually match the values from react-is! */
735export type ReactSymbol =
@@ -18,16 +46,15 @@ export type ReactSymbol =
1846 | 'react.memo' /* 0xead3 | Symbol(react.memo) */
1947 | 'react.lazy' /* 0xead4 | Symbol(react.lazy) */
2048
21- export const REACT_ELEMENT_TYPE : 'react.element' = is . Element
22- export const REACT_PORTAL_TYPE : 'react.portal' = is . Portal
23- export const REACT_FRAGMENT_TYPE : 'react.fragment' = is . Fragment
24- export const REACT_STRICT_MODE_TYPE : 'react.strict_mode' = is . StrictMode
25- export const REACT_PROFILER_TYPE : 'react.profiler' = is . Profiler
26- export const REACT_PROVIDER_TYPE : 'react.provider' = is . ContextProvider
27- export const REACT_CONTEXT_TYPE : 'react.context' = is . ContextConsumer
28- export const REACT_CONCURRENT_MODE_TYPE : 'react.concurrent_mode' =
29- is . ConcurrentMode
30- export const REACT_FORWARD_REF_TYPE : 'react.forward_ref' = is . ForwardRef
31- export const REACT_SUSPENSE_TYPE : 'react.suspense' = is . Suspense
32- export const REACT_MEMO_TYPE : 'react.memo' = is . Memo
33- export const REACT_LAZY_TYPE : 'react.lazy' = is . Lazy
49+ export const REACT_ELEMENT_TYPE : 'react.element' = ( Element : any )
50+ export const REACT_PORTAL_TYPE : 'react.portal' = ( Portal : any )
51+ export const REACT_FRAGMENT_TYPE : 'react.fragment' = ( Fragment : any )
52+ export const REACT_STRICT_MODE_TYPE : 'react.strict_mode' = ( StrictMode : any )
53+ export const REACT_PROFILER_TYPE : 'react.profiler' = ( Profiler : any )
54+ export const REACT_PROVIDER_TYPE : 'react.provider' = ( ContextProvider : any )
55+ export const REACT_CONTEXT_TYPE : 'react.context' = ( ContextConsumer : any )
56+ export const REACT_CONCURRENT_MODE_TYPE : 'react.concurrent_mode' = ( ConcurrentMode : any )
57+ export const REACT_FORWARD_REF_TYPE : 'react.forward_ref' = ( ForwardRef : any )
58+ export const REACT_SUSPENSE_TYPE : 'react.suspense' = ( Suspense : any )
59+ export const REACT_MEMO_TYPE : 'react.memo' = ( Memo : any )
60+ export const REACT_LAZY_TYPE : 'react.lazy' = ( Lazy : any )
0 commit comments