main
js 26 lines 906 Bytes
Raw
1 /**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @flow
8 */
9
10 import type {ReactContext} from 'shared/ReactTypes';
11
12 import type {Thenable} from 'shared/ReactTypes';
13
14 import {createContext} from 'react';
15 import typeof * as ParseHookNamesModule from 'react-devtools-shared/src/hooks/parseHookNames';
16
17 export type HookNamesModuleLoaderFunction =
18 () => Thenable<ParseHookNamesModule>;
19 export type Context = HookNamesModuleLoaderFunction | null;
20
21 // TODO (Webpack 5) Hopefully we can remove this context entirely once the Webpack 5 upgrade is completed.
22 const HookNamesModuleLoaderContext: ReactContext<Context> =
23 createContext<Context>(null);
24 HookNamesModuleLoaderContext.displayName = 'HookNamesModuleLoaderContext';
25
26 export default HookNamesModuleLoaderContext;