Skip to content

Commit 6bc4350

Browse files
committed
Move createReactNativeComponentClass to shims and delete internal usage
Since createReactNativeComponentClass is just an alias for the register there's no need to bundle it. This file should probably just move back to RN too.
1 parent 4100d8c commit 6bc4350

12 files changed

+29
-72
lines changed

packages/react-native-renderer/src/ReactFabric.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import * as ReactNativeComponentTree from './ReactNativeComponentTree';
2222
import ReactFabricRenderer from './ReactFabricRenderer';
2323
import ReactNativePropRegistry from './ReactNativePropRegistry';
2424
import {getInspectorDataForViewTag} from './ReactNativeFiberInspector';
25-
import createReactNativeComponentClass from './createReactNativeComponentClass';
2625
import {injectFindHostInstanceFabric} from './findNodeHandle';
2726
import findNumericNodeHandle from './findNumericNodeHandle';
2827
import takeSnapshot from './takeSnapshot';
@@ -82,7 +81,6 @@ const ReactFabric: ReactNativeType = {
8281
// Used by react-native-github/Libraries/ components
8382
ReactNativeComponentTree, // ScrollResponder
8483
ReactNativePropRegistry, // flattenStyle, Stylesheet
85-
createReactNativeComponentClass, // RCTText, RCTView, ReactNativeART
8684
takeSnapshot, // react-native-implementation
8785
},
8886
};

packages/react-native-renderer/src/ReactNativeRenderer.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import * as ReactNativeComponentTree from './ReactNativeComponentTree';
2626
import ReactNativeFiberRenderer from './ReactNativeFiberRenderer';
2727
import ReactNativePropRegistry from './ReactNativePropRegistry';
2828
import {getInspectorDataForViewTag} from './ReactNativeFiberInspector';
29-
import createReactNativeComponentClass from './createReactNativeComponentClass';
3029
import {injectFindHostInstance} from './findNodeHandle';
3130
import findNumericNodeHandle from './findNumericNodeHandle';
3231
import takeSnapshot from './takeSnapshot';
@@ -101,7 +100,6 @@ const ReactNativeRenderer: ReactNativeType = {
101100
// Used by react-native-github/Libraries/ components
102101
ReactNativeComponentTree, // ScrollResponder
103102
ReactNativePropRegistry, // flattenStyle, Stylesheet
104-
createReactNativeComponentClass, // RCTText, RCTView, ReactNativeART
105103
takeSnapshot, // react-native-implementation
106104
computeComponentStackForErrorReporting,
107105
},

packages/react-native-renderer/src/ReactNativeTypes.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ export type NativeMethodsMixinType = {
7171

7272
type SecretInternalsType = {
7373
NativeMethodsMixin: NativeMethodsMixinType,
74-
createReactNativeComponentClass(
75-
name: string,
76-
callback: ViewConfigGetter,
77-
): any,
7874
ReactNativeComponentTree: any,
7975
ReactNativePropRegistry: any,
8076
// TODO (bvaughn) Decide which additional types to expose here?

packages/react-native-renderer/src/__mocks__/View.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

packages/react-native-renderer/src/__tests__/ReactFabric-test.internal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ describe('ReactFabric', () => {
2828
ReactFabric = require('react-native-renderer/fabric');
2929
FabricUIManager = require('FabricUIManager');
3030
UIManager = require('UIManager');
31-
createReactNativeComponentClass = require('../createReactNativeComponentClass')
32-
.default;
31+
createReactNativeComponentClass = require('ReactNativeViewConfigRegistry')
32+
.register;
3333
});
3434

3535
it('should be able to create and render a native component', () => {

packages/react-native-renderer/src/__tests__/ReactNativeError-test.internal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ describe('ReactNativeError', () => {
2525

2626
React = require('react');
2727
ReactNative = require('react-native-renderer');
28-
createReactNativeComponentClass = require('../createReactNativeComponentClass')
29-
.default;
28+
createReactNativeComponentClass = require('ReactNativeViewConfigRegistry')
29+
.register;
3030
computeComponentStackForErrorReporting =
3131
ReactNative.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
3232
.computeComponentStackForErrorReporting;

packages/react-native-renderer/src/__tests__/ReactNativeEvents-test.internal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ beforeEach(() => {
6969
ReactNative = require('react-native-renderer');
7070
ResponderEventPlugin = require('events/ResponderEventPlugin').default;
7171
UIManager = require('UIManager');
72-
createReactNativeComponentClass = require('../createReactNativeComponentClass')
73-
.default;
72+
createReactNativeComponentClass = require('ReactNativeViewConfigRegistry')
73+
.register;
7474
});
7575

7676
it('fails if unknown/unsupported event types are dispatched', () => {

packages/react-native-renderer/src/__tests__/ReactNativeMount-test.internal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ describe('ReactNative', () => {
2222
React = require('react');
2323
ReactNative = require('react-native-renderer');
2424
UIManager = require('UIManager');
25-
createReactNativeComponentClass = require('../createReactNativeComponentClass')
26-
.default;
25+
createReactNativeComponentClass = require('ReactNativeViewConfigRegistry')
26+
.register;
2727
});
2828

2929
it('should be able to create and render a native component', () => {

packages/react-native-renderer/src/__tests__/createReactNativeComponentClass-test.internal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ describe('createReactNativeComponentClass', () => {
1818
beforeEach(() => {
1919
jest.resetModules();
2020

21-
createReactNativeComponentClass = require('../createReactNativeComponentClass')
22-
.default;
21+
createReactNativeComponentClass = require('ReactNativeViewConfigRegistry')
22+
.register;
2323
React = require('react');
2424
ReactNative = require('react-native-renderer');
2525
});

packages/react-native-renderer/src/createReactNativeComponentClass.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)