Skip to content

Commit 842a997

Browse files
committed
refactor: restore ReactNativeViewConfigRegistry to synced version
1 parent 440c4f0 commit 842a997

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {type ViewConfig} from './ReactNativeTypes';
1616
import invariant from 'invariant';
1717

1818
// Event configs
19-
export const customBubblingEventTypes: {
19+
const customBubblingEventTypes: {
2020
[eventName: string]: $ReadOnly<{
2121
phasedRegistrationNames: $ReadOnly<{
2222
captured: string,
@@ -26,13 +26,16 @@ export const customBubblingEventTypes: {
2626
}>,
2727
...
2828
} = {};
29-
export const customDirectEventTypes: {
29+
const customDirectEventTypes: {
3030
[eventName: string]: $ReadOnly<{
3131
registrationName: string,
3232
}>,
3333
...
3434
} = {};
3535

36+
exports.customBubblingEventTypes = customBubblingEventTypes;
37+
exports.customDirectEventTypes = customDirectEventTypes;
38+
3639
const viewConfigCallbacks = new Map<string, ?() => ViewConfig>();
3740
const viewConfigs = new Map<string, ViewConfig>();
3841

@@ -74,7 +77,7 @@ function processEventTypes(viewConfig: ViewConfig): void {
7477
* A callback is provided to load the view config from UIManager.
7578
* The callback is deferred until the view is actually rendered.
7679
*/
77-
export function register(name: string, callback: () => ViewConfig): string {
80+
exports.register = function (name: string, callback: () => ViewConfig): string {
7881
invariant(
7982
!viewConfigCallbacks.has(name),
8083
'Tried to register two views with the same name %s',
@@ -95,7 +98,7 @@ export function register(name: string, callback: () => ViewConfig): string {
9598
* If this is the first time the view has been used,
9699
* This configuration will be lazy-loaded from UIManager.
97100
*/
98-
export function get(name: string): ViewConfig {
101+
exports.get = function (name: string): ViewConfig {
99102
let viewConfig;
100103
if (!viewConfigs.has(name)) {
101104
const callback = viewConfigCallbacks.get(name);

0 commit comments

Comments
 (0)