Files
react/packages/react-devtools-shared/src/devtools/views/context.js
T
Brian VaughnandGitHub c7e696b944 Fix flow types (#18204)
* Added missing @flow pragma to React.js

* Fixed useContext() return type definition

* Fixed previously masked Flow errors in DevTools and react-interactions packages

* Added displayName to internal Context Flow type

* Removed Flow generic annotations for createResponder

This seems to cause a parsing error. (Not sure why.) The API is deprecated anyway so I'm being lazy for now and just adding a .
2020-03-03 12:46:24 -08:00

34 lines
1.0 KiB
JavaScript

/**
* Copyright (c) Facebook, Inc. and its 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 {createContext} from 'react';
import Store from '../store';
import type {ViewAttributeSource} from 'react-devtools-shared/src/devtools/views/DevTools';
import type {FrontendBridge} from 'react-devtools-shared/src/bridge';
export const BridgeContext = createContext<FrontendBridge>(
((null: any): FrontendBridge),
);
BridgeContext.displayName = 'BridgeContext';
export const StoreContext = createContext<Store>(((null: any): Store));
StoreContext.displayName = 'StoreContext';
export type ContextMenuContextType = {|
isEnabledForInspectedElement: boolean,
viewAttributeSourceFunction: ViewAttributeSource | null,
|};
export const ContextMenuContext = createContext<ContextMenuContextType>({
isEnabledForInspectedElement: false,
viewAttributeSourceFunction: null,
});
ContextMenuContext.displayName = 'ContextMenuContext';