mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
* 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 .
34 lines
1.0 KiB
JavaScript
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';
|