GeezerVison is showing github.com — Remove cycle between ReactFiberHooks and ReactInternalTypes (#20242) · react/react@2fbcc98
File treeExpand file treeCollapse file tree Open diff view settings packages/react-reconciler/src
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberHooks.new.js +1-17Lines changed: 1 addition & 17 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -13,7 +13,7 @@ import type { | 13 | 13 | MutableSourceSubscribeFn, | 14 | 14 | ReactContext, | 15 | 15 | } from 'shared/ReactTypes'; | 16 | | -import type {Fiber, Dispatcher} from './ReactInternalTypes'; | | 16 | +import type {Fiber, Dispatcher, HookType} from './ReactInternalTypes'; | 17 | 17 | import type {Lanes, Lane} from './ReactFiberLane'; | 18 | 18 | import type {HookFlags} from './ReactHookEffectTags'; | 19 | 19 | import type {ReactPriorityLevel} from './ReactInternalTypes'; | @@ -118,22 +118,6 @@ type UpdateQueue<S, A> = {| | 118 | 118 | lastRenderedState: S | null, | 119 | 119 | |}; | 120 | 120 |
| 121 | | -export type HookType = | 122 | | - | 'useState' | 123 | | - | 'useReducer' | 124 | | - | 'useContext' | 125 | | - | 'useRef' | 126 | | - | 'useEffect' | 127 | | - | 'useLayoutEffect' | 128 | | - | 'useCallback' | 129 | | - | 'useMemo' | 130 | | - | 'useImperativeHandle' | 131 | | - | 'useDebugValue' | 132 | | - | 'useDeferredValue' | 133 | | - | 'useTransition' | 134 | | - | 'useMutableSource' | 135 | | - | 'useOpaqueIdentifier'; | 136 | | - | 137 | 121 | let didWarnAboutMismatchedHooksForComponent; | 138 | 122 | let didWarnAboutUseOpaqueIdentifier; | 139 | 123 | if (__DEV__) { | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberHooks.old.js +1-17Lines changed: 1 addition & 17 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -13,7 +13,7 @@ import type { | 13 | 13 | MutableSourceSubscribeFn, | 14 | 14 | ReactContext, | 15 | 15 | } from 'shared/ReactTypes'; | 16 | | -import type {Fiber, Dispatcher} from './ReactInternalTypes'; | | 16 | +import type {Fiber, Dispatcher, HookType} from './ReactInternalTypes'; | 17 | 17 | import type {Lanes, Lane} from './ReactFiberLane'; | 18 | 18 | import type {HookFlags} from './ReactHookEffectTags'; | 19 | 19 | import type {ReactPriorityLevel} from './ReactInternalTypes'; | @@ -109,22 +109,6 @@ type UpdateQueue<S, A> = {| | 109 | 109 | lastRenderedState: S | null, | 110 | 110 | |}; | 111 | 111 |
| 112 | | -export type HookType = | 113 | | - | 'useState' | 114 | | - | 'useReducer' | 115 | | - | 'useContext' | 116 | | - | 'useRef' | 117 | | - | 'useEffect' | 118 | | - | 'useLayoutEffect' | 119 | | - | 'useCallback' | 120 | | - | 'useMemo' | 121 | | - | 'useImperativeHandle' | 122 | | - | 'useDebugValue' | 123 | | - | 'useDeferredValue' | 124 | | - | 'useTransition' | 125 | | - | 'useMutableSource' | 126 | | - | 'useOpaqueIdentifier'; | 127 | | - | 128 | 112 | let didWarnAboutMismatchedHooksForComponent; | 129 | 113 | let didWarnAboutUseOpaqueIdentifier; | 130 | 114 | if (__DEV__) { | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactInternalTypes.js +17-1Lines changed: 17 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -21,12 +21,28 @@ import type {WorkTag} from './ReactWorkTags'; | 21 | 21 | import type {TypeOfMode} from './ReactTypeOfMode'; | 22 | 22 | import type {Flags} from './ReactFiberFlags'; | 23 | 23 | import type {Lane, LanePriority, Lanes, LaneMap} from './ReactFiberLane'; | 24 | | -import type {HookType} from './ReactFiberHooks.old'; | 25 | 24 | import type {RootTag} from './ReactRootTags'; | 26 | 25 | import type {TimeoutHandle, NoTimeout} from './ReactFiberHostConfig'; | 27 | 26 | import type {Wakeable} from 'shared/ReactTypes'; | 28 | 27 | import type {Interaction} from 'scheduler/src/Tracing'; | 29 | 28 |
| | 29 | +// Unwind Circular: moved from ReactFiberHooks.old | | 30 | +export type HookType = | | 31 | + | 'useState' | | 32 | + | 'useReducer' | | 33 | + | 'useContext' | | 34 | + | 'useRef' | | 35 | + | 'useEffect' | | 36 | + | 'useLayoutEffect' | | 37 | + | 'useCallback' | | 38 | + | 'useMemo' | | 39 | + | 'useImperativeHandle' | | 40 | + | 'useDebugValue' | | 41 | + | 'useDeferredValue' | | 42 | + | 'useTransition' | | 43 | + | 'useMutableSource' | | 44 | + | 'useOpaqueIdentifier'; | | 45 | + | 30 | 46 | export type ReactPriorityLevel = 99 | 98 | 97 | 96 | 95 | 90; | 31 | 47 |
| 32 | 48 | export type ContextDependency<T> = { | |
|