mirror of
https://github.com/status-im/react-native.git
synced 2025-02-22 14:18:23 +00:00
Remove fbjs/lib/emptyFunction from react-native
Summary: This removes `emptyFunction` usage from react-native. Reviewed By: yungsters Differential Revision: D13138187 fbshipit-source-id: eaa327884aac2cabb99024077e3407cb99c946d2
This commit is contained in:
parent
2de01cb54d
commit
cfef04e760
@ -26,7 +26,6 @@ const TouchableWithoutFeedback = require('TouchableWithoutFeedback');
|
||||
const UIManager = require('UIManager');
|
||||
|
||||
const createReactClass = require('create-react-class');
|
||||
const emptyFunction = require('fbjs/lib/emptyFunction');
|
||||
const invariant = require('fbjs/lib/invariant');
|
||||
const requireNativeComponent = require('requireNativeComponent');
|
||||
const warning = require('fbjs/lib/warning');
|
||||
@ -276,6 +275,8 @@ type Props = $ReadOnly<{|
|
||||
contextMenuHidden?: ?boolean,
|
||||
|}>;
|
||||
|
||||
const emptyFunctionThatReturnsTrue = () => true;
|
||||
|
||||
/**
|
||||
* A foundational component for inputting text into the app via a
|
||||
* keyboard. Props provide configurability for several features, such as
|
||||
@ -999,7 +1000,7 @@ const TextInput = createReactClass({
|
||||
onBlur={this._onBlur}
|
||||
onChange={this._onChange}
|
||||
onSelectionChange={this._onSelectionChange}
|
||||
onSelectionChangeShouldSetResponder={emptyFunction.thatReturnsTrue}
|
||||
onSelectionChangeShouldSetResponder={emptyFunctionThatReturnsTrue}
|
||||
text={this._getText()}
|
||||
/>
|
||||
);
|
||||
@ -1036,7 +1037,7 @@ const TextInput = createReactClass({
|
||||
onContentSizeChange={this.props.onContentSizeChange}
|
||||
onSelectionChange={this._onSelectionChange}
|
||||
onTextInput={this._onTextInput}
|
||||
onSelectionChangeShouldSetResponder={emptyFunction.thatReturnsTrue}
|
||||
onSelectionChangeShouldSetResponder={emptyFunctionThatReturnsTrue}
|
||||
text={this._getText()}
|
||||
dataDetectorTypes={this.props.dataDetectorTypes}
|
||||
onScroll={this._onScroll}
|
||||
@ -1089,7 +1090,7 @@ const TextInput = createReactClass({
|
||||
onContentSizeChange={this.props.onContentSizeChange}
|
||||
onSelectionChange={this._onSelectionChange}
|
||||
onTextInput={this._onTextInput}
|
||||
onSelectionChangeShouldSetResponder={emptyFunction.thatReturnsTrue}
|
||||
onSelectionChangeShouldSetResponder={emptyFunctionThatReturnsTrue}
|
||||
text={this._getText()}
|
||||
dataDetectorTypes={this.props.dataDetectorTypes}
|
||||
onScroll={this._onScroll}
|
||||
|
@ -17,8 +17,6 @@ const React = require('React');
|
||||
const StyleSheet = require('StyleSheet');
|
||||
const View = require('View');
|
||||
|
||||
const emptyFunction = require('fbjs/lib/emptyFunction');
|
||||
|
||||
import type {LayoutEvent, PressEvent} from 'CoreEventTypes';
|
||||
import type {GestureState} from 'PanResponder';
|
||||
|
||||
@ -55,6 +53,8 @@ const RIGHT_SWIPE_BOUNCE_BACK_DURATION = 300;
|
||||
const RIGHT_SWIPE_THRESHOLD = 30 * SLOW_SPEED_SWIPE_FACTOR;
|
||||
const DEFAULT_SWIPE_THRESHOLD = 30;
|
||||
|
||||
const emptyFunction = () => {};
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
children?: ?React.Node,
|
||||
isOpen?: ?boolean,
|
||||
|
9
Libraries/vendor/emitter/EventEmitter.js
vendored
9
Libraries/vendor/emitter/EventEmitter.js
vendored
@ -14,9 +14,10 @@
|
||||
const EmitterSubscription = require('EmitterSubscription');
|
||||
const EventSubscriptionVendor = require('EventSubscriptionVendor');
|
||||
|
||||
const emptyFunction = require('fbjs/lib/emptyFunction');
|
||||
const invariant = require('fbjs/lib/invariant');
|
||||
|
||||
const emptyFunctionThatReturnsTrue = () => true;
|
||||
|
||||
/**
|
||||
* @class EventEmitter
|
||||
* @description
|
||||
@ -155,10 +156,8 @@ class EventEmitter {
|
||||
] = (this._subscriber.getSubscriptionsForType(eventType): any);
|
||||
return subscriptions
|
||||
? subscriptions
|
||||
.filter(emptyFunction.thatReturnsTrue)
|
||||
.map(function(subscription) {
|
||||
return subscription.listener;
|
||||
})
|
||||
.filter(emptyFunctionThatReturnsTrue)
|
||||
.map(subscription => subscription.listener)
|
||||
: [];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user