mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
97c90ed883
Stacked on #28771 ReactDOMCurrentDispatcher has longer property names for various methods. These methods are only ever called internally and don't need to be represented with as many characters. This change shortens the names and aligns them with the hint codes we use in Flight. This alignment is passive since not all dispatcher methods will exist as flight instructions but where they can line up it seems reasonable to make them do so
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
/**
|
|
* 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 {EventPriority} from 'react-reconciler/src/ReactEventPriorities';
|
|
import type {HostDispatcher} from './shared/ReactDOMTypes';
|
|
|
|
import {NoEventPriority} from 'react-reconciler/src/ReactEventPriorities';
|
|
|
|
type ReactDOMInternals = {
|
|
Events: [any, any, any, any, any, any],
|
|
d /* ReactDOMCurrentDispatcher */: HostDispatcher,
|
|
p /* currentUpdatePriority */: EventPriority,
|
|
findDOMNode:
|
|
| null
|
|
| ((
|
|
componentOrElement: React$Component<any, any>,
|
|
) => null | Element | Text),
|
|
};
|
|
|
|
function noop() {}
|
|
|
|
const DefaultDispatcher: HostDispatcher = {
|
|
f /* flushSyncWork */: noop,
|
|
D /* prefetchDNS */: noop,
|
|
C /* preconnect */: noop,
|
|
L /* preload */: noop,
|
|
m /* preloadModule */: noop,
|
|
X /* preinitScript */: noop,
|
|
S /* preinitStyle */: noop,
|
|
M /* preinitModuleScript */: noop,
|
|
};
|
|
|
|
const Internals: ReactDOMInternals = {
|
|
Events: (null: any),
|
|
d /* ReactDOMCurrentDispatcher */: DefaultDispatcher,
|
|
p /* currentUpdatePriority */: NoEventPriority,
|
|
findDOMNode: null,
|
|
};
|
|
|
|
export default Internals;
|