diff --git a/Libraries/Components/CheckBox/CheckBox.android.js b/Libraries/Components/CheckBox/CheckBox.android.js index 5417a0e81..0c7f13dec 100644 --- a/Libraries/Components/CheckBox/CheckBox.android.js +++ b/Libraries/Components/CheckBox/CheckBox.android.js @@ -18,6 +18,8 @@ const ViewPropTypes = require('ViewPropTypes'); const createReactClass = require('create-react-class'); const requireNativeComponent = require('requireNativeComponent'); +const RCTCheckBox = requireNativeComponent('AndroidCheckBox'); + type DefaultProps = { value: boolean, disabled: boolean, @@ -155,12 +157,4 @@ let styles = StyleSheet.create({ }, }); -let RCTCheckBox = requireNativeComponent('AndroidCheckBox', CheckBox, { - nativeOnly: { - onChange: true, - on: true, - enabled: true, - }, -}); - module.exports = CheckBox; diff --git a/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js b/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js index 6b983cb2a..d4b3fa9f7 100644 --- a/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +++ b/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js @@ -321,9 +321,6 @@ const styles = StyleSheet.create({ }); // The View that contains both the actual drawer and the main view -const AndroidDrawerLayout = requireNativeComponent( - 'AndroidDrawerLayout', - DrawerLayoutAndroid, -); +const AndroidDrawerLayout = requireNativeComponent('AndroidDrawerLayout'); module.exports = DrawerLayoutAndroid; diff --git a/Libraries/Components/Picker/PickerAndroid.android.js b/Libraries/Components/Picker/PickerAndroid.android.js index c0ce723e4..1f80aa392 100644 --- a/Libraries/Components/Picker/PickerAndroid.android.js +++ b/Libraries/Components/Picker/PickerAndroid.android.js @@ -21,6 +21,9 @@ const ViewStylePropTypes = require('ViewStylePropTypes'); const processColor = require('processColor'); const requireNativeComponent = require('requireNativeComponent'); +const DropdownPicker = requireNativeComponent('AndroidDropdownPicker'); +const DialogPicker = requireNativeComponent('AndroidDialogPicker'); + const REF_PICKER = 'picker'; const MODE_DROPDOWN = 'dropdown'; @@ -158,22 +161,4 @@ const styles = StyleSheet.create({ }, }); -const cfg = { - nativeOnly: { - items: true, - selected: true, - }, -}; - -const DropdownPicker = requireNativeComponent( - 'AndroidDropdownPicker', - PickerAndroid, - cfg, -); -const DialogPicker = requireNativeComponent( - 'AndroidDialogPicker', - PickerAndroid, - cfg, -); - module.exports = PickerAndroid; diff --git a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js index 9ee432f56..7ea083dd0 100644 --- a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +++ b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js @@ -12,7 +12,6 @@ const ColorPropType = require('ColorPropType'); const PropTypes = require('prop-types'); const React = require('React'); -const ReactNative = require('ReactNative'); const ViewPropTypes = require('ViewPropTypes'); const requireNativeComponent = require('requireNativeComponent'); @@ -115,15 +114,7 @@ class ProgressBarAndroid extends React.Component { } } -const AndroidProgressBar = requireNativeComponent( - 'AndroidProgressBar', - ProgressBarAndroid, - { - nativeOnly: { - animating: true, - }, - }, -); +const AndroidProgressBar = requireNativeComponent('AndroidProgressBar'); module.exports = React.forwardRef((props, ref) => ( diff --git a/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js b/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js index 44fb44da4..b8825977a 100644 --- a/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js +++ b/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js @@ -143,6 +143,6 @@ const styles = StyleSheet.create({ }, }); -const RCTTabBarItem = requireNativeComponent('RCTTabBarItem', TabBarItemIOS); +const RCTTabBarItem = requireNativeComponent('RCTTabBarItem'); module.exports = TabBarItemIOS; diff --git a/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js b/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js index 5fc04a425..44bcfc03d 100644 --- a/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js +++ b/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js @@ -13,7 +13,6 @@ const Image = require('Image'); const NativeMethodsMixin = require('NativeMethodsMixin'); const React = require('React'); const PropTypes = require('prop-types'); -const ReactNativeViewAttributes = require('ReactNativeViewAttributes'); const UIManager = require('UIManager'); const ViewPropTypes = require('ViewPropTypes'); const ColorPropType = require('ColorPropType'); @@ -207,10 +206,6 @@ const ToolbarAndroid = createReactClass({ }, }); -const NativeToolbar = requireNativeComponent('ToolbarAndroid', ToolbarAndroid, { - nativeOnly: { - nativeActions: true, - }, -}); +const NativeToolbar = requireNativeComponent('ToolbarAndroid'); module.exports = ToolbarAndroid; diff --git a/Libraries/Components/ViewPager/ViewPagerAndroid.android.js b/Libraries/Components/ViewPager/ViewPagerAndroid.android.js index 4b75cfb42..2ccdd31b5 100644 --- a/Libraries/Components/ViewPager/ViewPagerAndroid.android.js +++ b/Libraries/Components/ViewPager/ViewPagerAndroid.android.js @@ -19,6 +19,8 @@ const ViewPropTypes = require('ViewPropTypes'); const dismissKeyboard = require('dismissKeyboard'); const requireNativeComponent = require('requireNativeComponent'); +const NativeAndroidViewPager = requireNativeComponent('AndroidViewPager'); + const VIEWPAGER_REF = 'viewPager'; type Event = Object; @@ -255,9 +257,4 @@ class ViewPagerAndroid extends React.Component<{ } } -const NativeAndroidViewPager = requireNativeComponent( - 'AndroidViewPager', - ViewPagerAndroid, -); - module.exports = ViewPagerAndroid; diff --git a/Libraries/Components/WebView/WebView.android.js b/Libraries/Components/WebView/WebView.android.js index 0d1c7b0c9..4d4b65fb1 100644 --- a/Libraries/Components/WebView/WebView.android.js +++ b/Libraries/Components/WebView/WebView.android.js @@ -43,14 +43,6 @@ const defaultRenderLoading = () => ( * Renders a native WebView. */ class WebView extends React.Component { - static get extraNativeComponentConfig() { - return { - nativeOnly: { - messagingEnabled: PropTypes.bool, - }, - }; - } - static propTypes = { ...ViewPropTypes, renderError: PropTypes.func, @@ -464,11 +456,7 @@ class WebView extends React.Component { }; } -const RCTWebView = requireNativeComponent( - 'RCTWebView', - WebView, - WebView.extraNativeComponentConfig, -); +const RCTWebView = requireNativeComponent('RCTWebView'); const styles = StyleSheet.create({ container: { diff --git a/Libraries/Components/WebView/WebView.ios.js b/Libraries/Components/WebView/WebView.ios.js index 8d78103d7..ca91bc3b8 100644 --- a/Libraries/Components/WebView/WebView.ios.js +++ b/Libraries/Components/WebView/WebView.ios.js @@ -109,18 +109,6 @@ const defaultRenderError = (errorDomain, errorCode, errorDesc) => ( class WebView extends React.Component { static JSNavigationScheme = JSNavigationScheme; static NavigationType = NavigationType; - static get extraNativeComponentConfig() { - return { - nativeOnly: { - onLoadingStart: true, - onLoadingError: true, - onLoadingFinish: true, - onMessage: true, - messagingEnabled: PropTypes.bool, - }, - }; - } - static propTypes = { ...ViewPropTypes, @@ -651,11 +639,7 @@ class WebView extends React.Component { }; } -const RCTWebView = requireNativeComponent( - 'RCTWebView', - WebView, - WebView.extraNativeComponentConfig, -); +const RCTWebView = requireNativeComponent('RCTWebView'); const styles = StyleSheet.create({ container: { diff --git a/Libraries/Image/Image.android.js b/Libraries/Image/Image.android.js index cf87d4bc7..350bba68e 100644 --- a/Libraries/Image/Image.android.js +++ b/Libraries/Image/Image.android.js @@ -29,6 +29,9 @@ const resolveAssetSource = require('resolveAssetSource'); const {ImageLoader} = NativeModules; +const RKImage = requireNativeComponent('RCTImageView'); +const RCTTextInlineImage = requireNativeComponent('RCTTextInlineImage'); + let _requestId = 1; function generateRequestId() { return _requestId++; @@ -278,20 +281,4 @@ const styles = StyleSheet.create({ }, }); -const cfg = { - nativeOnly: { - src: true, - headers: true, - defaultSrc: true, - loadingIndicatorSrc: true, - shouldNotifyLoadEvents: true, - }, -}; -const RKImage = requireNativeComponent('RCTImageView', Image, cfg); -const RCTTextInlineImage = requireNativeComponent( - 'RCTTextInlineImage', - Image, - cfg, -); - module.exports = Image; diff --git a/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule.js b/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule.js index 9f19e0e39..312dcb2c5 100644 --- a/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule.js +++ b/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule.js @@ -11,14 +11,13 @@ var BatchedBridge = require('BatchedBridge'); var React = require('React'); -var ReactNativeViewAttributes = require('ReactNativeViewAttributes'); var ScrollView = require('ScrollView'); var StyleSheet = require('StyleSheet'); var View = require('View'); var requireNativeComponent = require('requireNativeComponent'); -var ClippableView = requireNativeComponent('ClippableView', null); +var ClippableView = requireNativeComponent('ClippableView'); class ClippingSample1 extends React.Component { render() {