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
This commit is contained in:
Eli White
2018-08-24 14:01:57 -07:00
committed by Facebook Github Bot
parent 035597566f
commit d2c27f5bff
7 changed files with 5 additions and 718 deletions

View File

@@ -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);