Skip to content

Commit

Permalink
Delete ensureComponentIsNative.js
Browse files Browse the repository at this point in the history
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
  • Loading branch information
elicwhite authored and facebook-github-bot committed Aug 14, 2019
1 parent d00f088 commit 9a31fa5
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 35 deletions.
23 changes: 0 additions & 23 deletions Libraries/Components/Touchable/ensureComponentIsNative.js

This file was deleted.

6 changes: 0 additions & 6 deletions Libraries/Components/UnimplementedViews/UnimplementedView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
3 changes: 0 additions & 3 deletions Libraries/Image/ImageBackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Image> which supports nesting views.
*
Expand Down Expand Up @@ -45,7 +43,6 @@ class ImageBackground extends React.Component<$FlowFixMeProps> {
// Work-around flow
const viewRef = this._viewRef;
if (viewRef) {
ensureComponentIsNative(viewRef);
viewRef.setNativeProps(props);
}
}
Expand Down
3 changes: 0 additions & 3 deletions jest/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 9a31fa5

Please sign in to comment.