diff --git a/flow/environment.js b/flow/environment.js deleted file mode 100644 index fa020bf8aa..0000000000 --- a/flow/environment.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @flow - */ - -/* eslint-disable */ - -declare var __REACT_DEVTOOLS_GLOBAL_HOOK__: any; /*?{ - inject: ?((stuff: Object) => void) -};*/ - -// temporary patches for React.Component and React.Element -declare var ReactComponent: typeof React$Component; -declare var ReactElement: typeof React$Element; diff --git a/flow/react-native-host-hooks.js b/flow/react-native-host-hooks.js deleted file mode 100644 index 0f96747133..0000000000 --- a/flow/react-native-host-hooks.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @flow - */ - -/* eslint-disable */ - -declare module 'deepDiffer' { - declare function exports(one: any, two: any): bool; -} -declare module 'deepFreezeAndThrowOnMutationInDev' { - declare function exports(obj : T) : T; -} -declare module 'flattenStyle' { } -declare module 'InitializeCore' { } -declare module 'RCTEventEmitter' { - declare function register() : void; -} -declare module 'TextInputState' { - declare function blurTextInput(object : any) : void; - declare function focusTextInput(object : any) : void; -} -declare module 'UIManager' { - declare var customBubblingEventTypes : Object; - declare var customDirectEventTypes : Object; - declare function createView( - reactTag : number, - viewName : string, - rootTag : number, - props : ?Object, - ) : void; - declare function manageChildren( - containerTag : number, - moveFromIndices : Array, - moveToIndices : Array, - addChildReactTags : Array, - addAtIndices : Array, - removeAtIndices : Array - ) : void; - declare function measure() : void; - declare function measureInWindow() : void; - declare function measureLayout() : void; - declare function removeRootView() : void; - declare function removeSubviewsFromContainerWithID() : void; - declare function replaceExistingNonRootView() : void; - declare function setChildren( - containerTag : number, - reactTags : Array, - ) : void; - declare function updateView( - reactTag : number, - viewName : string, - props : ?Object, - ) : void; -} -declare module 'View' { - declare var exports : typeof ReactComponent; -} diff --git a/src/isomorphic/classic/element/ReactDebugCurrentFrame.js b/src/isomorphic/classic/element/ReactDebugCurrentFrame.js index 7a36e4f257..eb1d1ecaa4 100644 --- a/src/isomorphic/classic/element/ReactDebugCurrentFrame.js +++ b/src/isomorphic/classic/element/ReactDebugCurrentFrame.js @@ -14,16 +14,18 @@ import type { Fiber } from 'ReactFiber'; import type { DebugID } from 'ReactInstanceType'; -import type { ComponentTreeHookType } from '../../hooks/ReactComponentTreeHook'; +import type { ComponentTreeHookDevType } from '../../hooks/ReactComponentTreeHook'; const ReactDebugCurrentFrame = {}; if (__DEV__) { + // how do a state that ReactComponentTreeHook is using the ComponentTreeHookDevType type? + const ReactComponentTreeHook: ComponentTreeHookDevType = require('ReactComponentTreeHook'); const { getStackAddendumByID, getStackAddendumByWorkInProgressFiber, getCurrentStackAddendum, - }: ComponentTreeHookType = require('ReactComponentTreeHook'); + } = ReactComponentTreeHook; // Component that is being worked on ReactDebugCurrentFrame.current = (null : Fiber | DebugID | null); @@ -38,9 +40,7 @@ if (__DEV__) { if (typeof current === 'number') { // DebugID from Stack. const debugID = current; - if (getStackAddendumByID) { - stack = getStackAddendumByID(debugID); - } + stack = getStackAddendumByID(debugID); } else if (typeof current.tag === 'number') { // This is a Fiber. // The stack will only be correct if this is a work in progress @@ -49,9 +49,7 @@ if (__DEV__) { stack = getStackAddendumByWorkInProgressFiber(workInProgress); } } else if (element !== null) { - if (getCurrentStackAddendum) { - stack = getCurrentStackAddendum(element); - } + stack = getCurrentStackAddendum(element); } return stack; }; diff --git a/src/isomorphic/hooks/ReactComponentTreeHook.js b/src/isomorphic/hooks/ReactComponentTreeHook.js index a268651098..c7e2141b34 100644 --- a/src/isomorphic/hooks/ReactComponentTreeHook.js +++ b/src/isomorphic/hooks/ReactComponentTreeHook.js @@ -57,16 +57,20 @@ function describeFiber(fiber : Fiber) : string { export type ComponentTreeHookType = { getStackAddendumByWorkInProgressFiber: (Fiber) => any, - getStackAddendumByID?: () => any, - getCurrentStackAddendum?: () => any, - purgeUnmountedComponents?: () => any, - getOwnerID?: (DebugID) => any, - getParentID?: (DebugID) => any, - getDisplayName?: (DebugID) => any, - getText?: (DebugID) => any, - getUpdateCount?: (DebugID) => any, - getChildIDs?: (DebugID) => any, - getRegisteredIDs?: () => any, +}; + +export type ComponentTreeHookDevType = { + getStackAddendumByWorkInProgressFiber: (Fiber) => any, + getStackAddendumByID: () => any, + getCurrentStackAddendum: () => any, + purgeUnmountedComponents: () => any, + getOwnerID: (DebugID) => any, + getParentID: (DebugID) => any, + getDisplayName: (DebugID) => any, + getText: (DebugID) => any, + getUpdateCount: (DebugID) => any, + getChildIDs: (DebugID) => any, + getRegisteredIDs: () => any, }; var ReactComponentTreeHook: ComponentTreeHookType = {