From 17687d16326dce220912d3fdd02a141793b183f0 Mon Sep 17 00:00:00 2001 From: lukewalczak Date: Wed, 9 Jan 2019 09:50:00 +0100 Subject: [PATCH] fix: fix flow errors --- src/Slider/Slider.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Slider/Slider.js b/src/Slider/Slider.js index 486c56f..959acba 100644 --- a/src/Slider/Slider.js +++ b/src/Slider/Slider.js @@ -25,6 +25,17 @@ type Props = {| +customMarker?: React.Node, |}; +type OnLayout = { + +nativeEvent: { + +layout: { + +x: number, + +y: number, + +width: number, + +height: number, + }, + }, +}; + type State = { multiSliderValues: Array, singleSliderValue: Array, @@ -35,7 +46,11 @@ export default class Slider extends React.Component { constructor(props: Props) { super(props); - const { startValue, endValue } = this.props; + const { maxValue, startValue, endValue = maxValue } = this.props; + + if (endValue > maxValue) { + console.error('End value cannot be equal or higher than maximum value'); + } this.state = { width: 0,