Slider remove $FlowFixMe
Reviewed By: sahrens Differential Revision: D8234803 fbshipit-source-id: cfc0466a54f3c219d8a2eadfebf840399a2abdd8
This commit is contained in:
parent
d29821278e
commit
e0db8ee645
|
@ -249,17 +249,10 @@ const Slider = createReactClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
const {style, onValueChange, onSlidingComplete, ...props} = this.props;
|
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.style = [styles.slider, style];
|
|
||||||
|
|
||||||
/* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment
|
const onValueChange =
|
||||||
* suppresses an error found when Flow v0.54 was deployed. To see the error
|
this.props.onValueChange &&
|
||||||
* delete this comment and run Flow. */
|
|
||||||
props.onValueChange =
|
|
||||||
onValueChange &&
|
|
||||||
((event: Event) => {
|
((event: Event) => {
|
||||||
let userEvent = true;
|
let userEvent = true;
|
||||||
if (Platform.OS === 'android') {
|
if (Platform.OS === 'android') {
|
||||||
|
@ -267,26 +260,27 @@ const Slider = createReactClass({
|
||||||
// dragging the slider.
|
// dragging the slider.
|
||||||
userEvent = event.nativeEvent.fromUser;
|
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
|
const onChange = this.props.onValueChange;
|
||||||
* suppresses an error found when Flow v0.54 was deployed. To see the error
|
|
||||||
* delete this comment and run Flow. */
|
|
||||||
props.onChange = props.onValueChange;
|
|
||||||
|
|
||||||
/* $FlowFixMe(>=0.54.0 site=react_native_fb,react_native_oss) This comment
|
const onSlidingComplete =
|
||||||
* suppresses an error found when Flow v0.54 was deployed. To see the error
|
this.props.onSlidingComplete &&
|
||||||
* delete this comment and run Flow. */
|
|
||||||
props.onSlidingComplete =
|
|
||||||
onSlidingComplete &&
|
|
||||||
((event: Event) => {
|
((event: Event) => {
|
||||||
onSlidingComplete && onSlidingComplete(event.nativeEvent.value);
|
this.props.onSlidingComplete &&
|
||||||
|
this.props.onSlidingComplete(event.nativeEvent.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RCTSlider
|
<RCTSlider
|
||||||
{...props}
|
{...this.props}
|
||||||
|
style={style}
|
||||||
|
onChange={onChange}
|
||||||
|
onSlidingComplete={onSlidingComplete}
|
||||||
|
onValueChange={onValueChange}
|
||||||
enabled={!this.props.disabled}
|
enabled={!this.props.disabled}
|
||||||
onStartShouldSetResponder={() => true}
|
onStartShouldSetResponder={() => true}
|
||||||
onResponderTerminationRequest={() => false}
|
onResponderTerminationRequest={() => false}
|
||||||
|
|
Loading…
Reference in New Issue