diff --git a/Libraries/Components/Touchable/ensureComponentIsNative.js b/Libraries/Components/Touchable/ensureComponentIsNative.js deleted file mode 100644 index dbf166e4b05..00000000000 --- a/Libraries/Components/Touchable/ensureComponentIsNative.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @format - * @flow - */ - -'use strict'; - -const invariant = require('invariant'); - -const ensureComponentIsNative = function(component: any) { - invariant( - component && typeof component.setNativeProps === 'function', - 'Touchable child must either be native or forward setNativeProps to a ' + - 'native component', - ); -}; - -module.exports = ensureComponentIsNative; diff --git a/Libraries/Components/UnimplementedViews/UnimplementedView.js b/Libraries/Components/UnimplementedViews/UnimplementedView.js index 4d091bd660f..59725244cef 100644 --- a/Libraries/Components/UnimplementedViews/UnimplementedView.js +++ b/Libraries/Components/UnimplementedViews/UnimplementedView.js @@ -17,12 +17,6 @@ const StyleSheet = require('../../StyleSheet/StyleSheet'); * View component and renders its children. */ class UnimplementedView extends React.Component<$FlowFixMeProps> { - setNativeProps() { - // Do nothing. - // This method is required in order to use this view as a Touchable* child. - // See ensureComponentIsNative.js for more info - } - render(): React.Node { // Workaround require cycle from requireNativeComponent const View = require('../View/View'); diff --git a/Libraries/Image/ImageBackground.js b/Libraries/Image/ImageBackground.js index e6baa48012c..f9f694f6084 100644 --- a/Libraries/Image/ImageBackground.js +++ b/Libraries/Image/ImageBackground.js @@ -14,8 +14,6 @@ const React = require('react'); const StyleSheet = require('../StyleSheet/StyleSheet'); const View = require('../Components/View/View'); -const ensureComponentIsNative = require('../Components/Touchable/ensureComponentIsNative'); - /** * Very simple drop-in replacement for which supports nesting views. * @@ -45,7 +43,6 @@ class ImageBackground extends React.Component<$FlowFixMeProps> { // Work-around flow const viewRef = this._viewRef; if (viewRef) { - ensureComponentIsNative(viewRef); viewRef.setNativeProps(props); } } diff --git a/jest/setup.js b/jest/setup.js index 644d659241c..954d9fd76d2 100644 --- a/jest/setup.js +++ b/jest/setup.js @@ -172,9 +172,6 @@ jest return ReactNative; }) - .mock('../Libraries/Components/Touchable/ensureComponentIsNative', () => () => - true, - ) // Mock modules defined by the native layer (ex: Objective-C, Java) .mock('../Libraries/BatchedBridge/NativeModules', () => ({ AlertManager: {