mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
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:
committed by
Facebook Github Bot
parent
035597566f
commit
d2c27f5bff
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user