Skip to content

Commit 4e2479b

Browse files
committed
Add @__PURE__ annotations to all react-is symbols
1 parent b14e12a commit 4e2479b

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

src/utils/react-is.ts

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,27 @@ import type { ElementType, MemoExoticComponent, ReactElement } from 'react'
55
// It's very possible this could change in the future, but given that
66
// we only use these in `connect`, this is a low priority.
77

8-
const REACT_ELEMENT_TYPE = Symbol.for('react.element')
9-
const REACT_PORTAL_TYPE = Symbol.for('react.portal')
10-
const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment')
11-
const REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode')
12-
const REACT_PROFILER_TYPE = Symbol.for('react.profiler')
13-
const REACT_PROVIDER_TYPE = Symbol.for('react.provider')
14-
const REACT_CONTEXT_TYPE = Symbol.for('react.context')
15-
const REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context')
16-
const REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref')
17-
const REACT_SUSPENSE_TYPE = Symbol.for('react.suspense')
18-
const REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list')
19-
const REACT_MEMO_TYPE = Symbol.for('react.memo')
20-
const REACT_LAZY_TYPE = Symbol.for('react.lazy')
21-
const REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen')
22-
const REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference')
8+
const REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for('react.element')
9+
const REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for('react.portal')
10+
const REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for('react.fragment')
11+
const REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for('react.strict_mode')
12+
const REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for('react.profiler')
13+
const REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for('react.provider')
14+
const REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for('react.context')
15+
const REACT_SERVER_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for(
16+
'react.server_context',
17+
)
18+
const REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for('react.forward_ref')
19+
const REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for('react.suspense')
20+
const REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for(
21+
'react.suspense_list',
22+
)
23+
const REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for('react.memo')
24+
const REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for('react.lazy')
25+
const REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for('react.offscreen')
26+
const REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for(
27+
'react.client.reference',
28+
)
2329

2430
export const ForwardRef = REACT_FORWARD_REF_TYPE
2531
export const Memo = REACT_MEMO_TYPE

0 commit comments

Comments
 (0)