Skip to content

Commit 2463531

Browse files
committed
Add @__PURE__ annotations to react-is symbols
1 parent 2a1208e commit 2463531

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

src/utils/react-is.ts

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,28 @@ import * as React from 'react'
66
// It's very possible this could change in the future, but given that
77
// we only use these in `connect`, this is a low priority.
88

9-
export const IS_REACT_19 = React.version.startsWith('19')
9+
export const IS_REACT_19 = /* @__PURE__ */ React.version.startsWith('19')
1010

11-
const REACT_ELEMENT_TYPE = Symbol.for(
11+
const REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for(
1212
IS_REACT_19 ? 'react.transitional.element' : 'react.element',
1313
)
14-
const REACT_PORTAL_TYPE = Symbol.for('react.portal')
15-
const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment')
16-
const REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode')
17-
const REACT_PROFILER_TYPE = Symbol.for('react.profiler')
18-
const REACT_CONSUMER_TYPE = Symbol.for('react.consumer')
19-
const REACT_CONTEXT_TYPE = Symbol.for('react.context')
20-
const REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref')
21-
const REACT_SUSPENSE_TYPE = Symbol.for('react.suspense')
22-
const REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list')
23-
const REACT_MEMO_TYPE = Symbol.for('react.memo')
24-
const REACT_LAZY_TYPE = Symbol.for('react.lazy')
25-
const REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen')
26-
const REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference')
14+
const REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for('react.portal')
15+
const REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for('react.fragment')
16+
const REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for('react.strict_mode')
17+
const REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for('react.profiler')
18+
const REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for('react.consumer')
19+
const REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for('react.context')
20+
const REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for('react.forward_ref')
21+
const REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for('react.suspense')
22+
const REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for(
23+
'react.suspense_list',
24+
)
25+
const REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for('react.memo')
26+
const REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for('react.lazy')
27+
const REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for('react.offscreen')
28+
const REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for(
29+
'react.client.reference',
30+
)
2731

2832
export const ForwardRef = REACT_FORWARD_REF_TYPE
2933
export const Memo = REACT_MEMO_TYPE

0 commit comments

Comments
 (0)