Revert D8234803: [RN] Slider remove $FlowFixMe

Differential Revision:
D8234803

Original commit changeset: cfc0466a54f3

fbshipit-source-id: 354fcc1853597cbcd518abaf4be5b11116f594b3
This commit is contained in:
Eli White 2018-06-01 19:48:11 -07:00 committed by Facebook Github Bot
parent ac9a3d0c99
commit 7498e5ce77
1 changed files with 22 additions and 16 deletions

View File

@ -249,10 +249,17 @@ const Slider = createReactClass({
},
render: function() {
const style = StyleSheet.compose(styles.slider, this.props.style);
const {style, onValueChange, onSlidingComplete, ...props} = this.props;
/* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error found when Flow v0.54 was deployed. To see the error
* delete this comment and run Flow. */
props.style = [styles.slider, style];
const onValueChange =
this.props.onValueChange &&
/* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error found when Flow v0.54 was deployed. To see the error
* delete this comment and run Flow. */
props.onValueChange =
onValueChange &&
((event: Event) => {
let userEvent = true;
if (Platform.OS === 'android') {
@ -260,27 +267,26 @@ const Slider = createReactClass({
// dragging the slider.
userEvent = event.nativeEvent.fromUser;
}
this.props.onValueChange &&
userEvent &&
this.props.onValueChange(event.nativeEvent.value);
onValueChange && userEvent && onValueChange(event.nativeEvent.value);
});
const onChange = this.props.onValueChange;
/* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error found when Flow v0.54 was deployed. To see the error
* delete this comment and run Flow. */
props.onChange = props.onValueChange;
const onSlidingComplete =
this.props.onSlidingComplete &&
/* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment
* suppresses an error found when Flow v0.54 was deployed. To see the error
* delete this comment and run Flow. */
props.onSlidingComplete =
onSlidingComplete &&
((event: Event) => {
this.props.onSlidingComplete &&
this.props.onSlidingComplete(event.nativeEvent.value);
onSlidingComplete && onSlidingComplete(event.nativeEvent.value);
});
return (
<RCTSlider
{...this.props}
style={style}
onChange={onChange}
onSlidingComplete={onSlidingComplete}
onValueChange={onValueChange}
{...props}
enabled={!this.props.disabled}
onStartShouldSetResponder={() => true}
onResponderTerminationRequest={() => false}