From e0db8ee645a237b96d7d0d8a20bf8ae70cbee04c Mon Sep 17 00:00:00 2001 From: Eli White Date: Fri, 1 Jun 2018 17:46:01 -0700 Subject: [PATCH] Slider remove $FlowFixMe Reviewed By: sahrens Differential Revision: D8234803 fbshipit-source-id: cfc0466a54f3c219d8a2eadfebf840399a2abdd8 --- Libraries/Components/Slider/Slider.js | 38 +++++++++++---------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/Libraries/Components/Slider/Slider.js b/Libraries/Components/Slider/Slider.js index efe22529f..e1de6b3c3 100644 --- a/Libraries/Components/Slider/Slider.js +++ b/Libraries/Components/Slider/Slider.js @@ -249,17 +249,10 @@ const Slider = createReactClass({ }, render: function() { - 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 style = StyleSheet.compose(styles.slider, this.props.style); - /* $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 && + const onValueChange = + this.props.onValueChange && ((event: Event) => { let userEvent = true; if (Platform.OS === 'android') { @@ -267,26 +260,27 @@ const Slider = createReactClass({ // dragging the slider. userEvent = event.nativeEvent.fromUser; } - onValueChange && userEvent && onValueChange(event.nativeEvent.value); + this.props.onValueChange && + userEvent && + this.props.onValueChange(event.nativeEvent.value); }); - /* $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 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.onSlidingComplete = - onSlidingComplete && + const onSlidingComplete = + this.props.onSlidingComplete && ((event: Event) => { - onSlidingComplete && onSlidingComplete(event.nativeEvent.value); + this.props.onSlidingComplete && + this.props.onSlidingComplete(event.nativeEvent.value); }); return ( true} onResponderTerminationRequest={() => false}