mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Resolve cycle
This commit is contained in:
committed by
Rick Hanlon
parent
1af924d03c
commit
88e47069c1
+1
-1
@@ -61,7 +61,7 @@ import {LegacyRoot} from 'react-reconciler/src/ReactRootTags';
|
||||
import getComponentNameFromType from 'shared/getComponentNameFromType';
|
||||
import {has as hasInstance} from 'shared/ReactInstanceMap';
|
||||
|
||||
import {currentOwner} from 'react-reconciler/src/ReactFiberAsyncDispatcher';
|
||||
import {currentOwner} from 'react-reconciler/src/ReactFiberCurrentOwner';
|
||||
|
||||
import assign from 'shared/assign';
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
} from 'react-reconciler/src/ReactFiberReconciler';
|
||||
import {doesFiberContain} from 'react-reconciler/src/ReactFiberTreeReflection';
|
||||
import getComponentNameFromType from 'shared/getComponentNameFromType';
|
||||
import {currentOwner} from 'react-reconciler/src/ReactFiberAsyncDispatcher';
|
||||
import {currentOwner} from 'react-reconciler/src/ReactFiberCurrentOwner';
|
||||
|
||||
export function findHostInstance_DEPRECATED<TElementType: ElementType>(
|
||||
componentOrHandle: ?(ElementRef<TElementType> | number),
|
||||
|
||||
@@ -16,6 +16,8 @@ import {CacheContext} from './ReactFiberCacheComponent';
|
||||
|
||||
import {disableStringRefs} from 'shared/ReactFeatureFlags';
|
||||
|
||||
import {currentOwner} from './ReactFiberCurrentOwner';
|
||||
|
||||
function getCacheForType<T>(resourceType: () => T): T {
|
||||
if (!enableCache) {
|
||||
throw new Error('Not implemented.');
|
||||
@@ -29,8 +31,6 @@ function getCacheForType<T>(resourceType: () => T): T {
|
||||
return cacheForType;
|
||||
}
|
||||
|
||||
export let currentOwner: Fiber | null = null;
|
||||
|
||||
export const DefaultAsyncDispatcher: AsyncDispatcher = ({
|
||||
getCacheForType,
|
||||
}: any);
|
||||
@@ -40,7 +40,3 @@ if (__DEV__ || !disableStringRefs) {
|
||||
return currentOwner;
|
||||
};
|
||||
}
|
||||
|
||||
export function setCurrentOwner(fiber: null | Fiber) {
|
||||
currentOwner = fiber;
|
||||
}
|
||||
|
||||
+1
-1
@@ -296,7 +296,7 @@ import {
|
||||
pushRootMarkerInstance,
|
||||
TransitionTracingMarker,
|
||||
} from './ReactFiberTracingMarkerComponent';
|
||||
import {setCurrentOwner} from './ReactFiberAsyncDispatcher';
|
||||
import {setCurrentOwner} from './ReactFiberCurrentOwner';
|
||||
|
||||
// A special exception that's used to unwind the stack when an update flows
|
||||
// into a dehydrated boundary.
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow
|
||||
*/
|
||||
|
||||
import type {Fiber} from './ReactInternalTypes';
|
||||
|
||||
export let currentOwner: Fiber | null = null;
|
||||
|
||||
export function setCurrentOwner(fiber: null | Fiber) {
|
||||
currentOwner = fiber;
|
||||
}
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
SuspenseComponent,
|
||||
} from './ReactWorkTags';
|
||||
import {NoFlags, Placement, Hydrating} from './ReactFiberFlags';
|
||||
import {currentOwner} from './ReactFiberAsyncDispatcher';
|
||||
import {currentOwner} from './ReactFiberCurrentOwner';
|
||||
|
||||
export function getNearestMountedFiber(fiber: Fiber): null | Fiber {
|
||||
let node = fiber;
|
||||
|
||||
+2
-4
@@ -203,10 +203,8 @@ import {
|
||||
resetHooksOnUnwind,
|
||||
ContextOnlyDispatcher,
|
||||
} from './ReactFiberHooks';
|
||||
import {
|
||||
DefaultAsyncDispatcher,
|
||||
setCurrentOwner,
|
||||
} from './ReactFiberAsyncDispatcher';
|
||||
import {DefaultAsyncDispatcher} from './ReactFiberAsyncDispatcher';
|
||||
import {setCurrentOwner} from './ReactFiberCurrentOwner';
|
||||
import {
|
||||
createCapturedValueAtFiber,
|
||||
type CapturedValue,
|
||||
|
||||
Reference in New Issue
Block a user