Skip to content

Commit 7b57b8c

Browse files
elicwhitehramos
authored andcommitted
Remove view configs from JS
Summary: Apparently different apps have different implementations of view managers that support different props. This is a problem that we will need to address. Unfortunately, this means we can't have a static config defined in JS. We will need to find another approach to this problem. Reviewed By: sahrens Differential Revision: D9500178 fbshipit-source-id: b591559164fcf29f5fd43e13a0f2da15011491c6
1 parent 967d478 commit 7b57b8c

4 files changed

Lines changed: 2 additions & 325 deletions

File tree

Libraries/Components/View/ViewNativeComponent.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,14 @@
1010

1111
'use strict';
1212

13-
const AndroidConfig = require('ViewNativeComponentAndroidConfig');
14-
const Platform = require('Platform');
1513
const ReactNative = require('ReactNative');
1614

17-
const verifyComponentAttributeEquivalence = require('verifyComponentAttributeEquivalence');
1815
const requireNativeComponent = require('requireNativeComponent');
19-
const ReactNativeViewConfigRegistry = require('ReactNativeViewConfigRegistry');
2016

2117
import type {ViewProps} from 'ViewPropTypes';
2218

2319
type ViewNativeComponentType = Class<ReactNative.NativeComponent<ViewProps>>;
2420

25-
let NativeViewComponent;
26-
if (Platform.OS === 'android') {
27-
if (__DEV__) {
28-
verifyComponentAttributeEquivalence('RCTView', AndroidConfig);
29-
}
30-
31-
NativeViewComponent = ReactNativeViewConfigRegistry.register('RCTView', () =>
32-
require('ViewNativeComponentAndroidConfig'),
33-
);
34-
} else {
35-
NativeViewComponent = requireNativeComponent('RCTView');
36-
}
21+
const NativeViewComponent = requireNativeComponent('RCTView');
3722

3823
module.exports = ((NativeViewComponent: any): ViewNativeComponentType);

Libraries/Components/View/ViewNativeComponentAndroidConfig.js

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

Libraries/Utilities/verifyComponentAttributeEquivalence.js

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

jest/setup.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ jest
9090

9191
return ReactNative;
9292
})
93-
.mock('ensureComponentIsNative', () => () => true)
94-
.mock('verifyComponentAttributeEquivalence', () => () => {});
93+
.mock('ensureComponentIsNative', () => () => true);
9594

9695
const mockEmptyObject = {};
9796
const mockNativeModules = {

0 commit comments

Comments
 (0)