Skip to content

Commit

Permalink
Remove view configs from JS
Browse files Browse the repository at this point in the history
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
  • Loading branch information
TheSavior authored and hramos committed Sep 11, 2018
1 parent 967d478 commit 7b57b8c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 325 deletions.
17 changes: 1 addition & 16 deletions Libraries/Components/View/ViewNativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,14 @@

'use strict';

const AndroidConfig = require('ViewNativeComponentAndroidConfig');
const Platform = require('Platform');
const ReactNative = require('ReactNative');

const verifyComponentAttributeEquivalence = require('verifyComponentAttributeEquivalence');
const requireNativeComponent = require('requireNativeComponent');
const ReactNativeViewConfigRegistry = require('ReactNativeViewConfigRegistry');

import type {ViewProps} from 'ViewPropTypes';

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

let NativeViewComponent;
if (Platform.OS === 'android') {
if (__DEV__) {
verifyComponentAttributeEquivalence('RCTView', AndroidConfig);
}

NativeViewComponent = ReactNativeViewConfigRegistry.register('RCTView', () =>
require('ViewNativeComponentAndroidConfig'),
);
} else {
NativeViewComponent = requireNativeComponent('RCTView');
}
const NativeViewComponent = requireNativeComponent('RCTView');

module.exports = ((NativeViewComponent: any): ViewNativeComponentType);
278 changes: 0 additions & 278 deletions Libraries/Components/View/ViewNativeComponentAndroidConfig.js

This file was deleted.

29 changes: 0 additions & 29 deletions Libraries/Utilities/verifyComponentAttributeEquivalence.js

This file was deleted.

3 changes: 1 addition & 2 deletions jest/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ jest

return ReactNative;
})
.mock('ensureComponentIsNative', () => () => true)
.mock('verifyComponentAttributeEquivalence', () => () => {});
.mock('ensureComponentIsNative', () => () => true);

const mockEmptyObject = {};
const mockNativeModules = {
Expand Down

0 comments on commit 7b57b8c

Please sign in to comment.