Skip to content

Commit 9a31fa5

Browse files
elicwhitefacebook-github-bot
authored andcommitted
Delete ensureComponentIsNative.js
Summary: This function was used by Touchable*. It was removed from the Touchables in D6494579 in 2017. The only remaining callsite was ImageBackground which is attaching a ref directly to the View so we know it is a native component. This is needed for some setNativeProps cleanup Reviewed By: sahrens Differential Revision: D16796973 fbshipit-source-id: 19379094b3b91920efac4bf1969fc22d4b80bcc6
1 parent d00f088 commit 9a31fa5

File tree

4 files changed

+0
-35
lines changed

4 files changed

+0
-35
lines changed

Libraries/Components/Touchable/ensureComponentIsNative.js

-23
This file was deleted.

Libraries/Components/UnimplementedViews/UnimplementedView.js

-6
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ const StyleSheet = require('../../StyleSheet/StyleSheet');
1717
* View component and renders its children.
1818
*/
1919
class UnimplementedView extends React.Component<$FlowFixMeProps> {
20-
setNativeProps() {
21-
// Do nothing.
22-
// This method is required in order to use this view as a Touchable* child.
23-
// See ensureComponentIsNative.js for more info
24-
}
25-
2620
render(): React.Node {
2721
// Workaround require cycle from requireNativeComponent
2822
const View = require('../View/View');

Libraries/Image/ImageBackground.js

-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ const React = require('react');
1414
const StyleSheet = require('../StyleSheet/StyleSheet');
1515
const View = require('../Components/View/View');
1616

17-
const ensureComponentIsNative = require('../Components/Touchable/ensureComponentIsNative');
18-
1917
/**
2018
* Very simple drop-in replacement for <Image> which supports nesting views.
2119
*
@@ -45,7 +43,6 @@ class ImageBackground extends React.Component<$FlowFixMeProps> {
4543
// Work-around flow
4644
const viewRef = this._viewRef;
4745
if (viewRef) {
48-
ensureComponentIsNative(viewRef);
4946
viewRef.setNativeProps(props);
5047
}
5148
}

jest/setup.js

-3
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,6 @@ jest
172172

173173
return ReactNative;
174174
})
175-
.mock('../Libraries/Components/Touchable/ensureComponentIsNative', () => () =>
176-
true,
177-
)
178175
// Mock modules defined by the native layer (ex: Objective-C, Java)
179176
.mock('../Libraries/BatchedBridge/NativeModules', () => ({
180177
AlertManager: {

0 commit comments

Comments
 (0)