From fe784c34470661ebe1c523af3fcd36b0e3c3909c Mon Sep 17 00:00:00 2001 From: RobertMurrayImprobable Date: Thu, 17 Dec 2020 12:26:49 +0000 Subject: [PATCH] RangeProps allows number for `pushable` The top-level `README` describes the `pushable` prop of `Range` as `boolean` or `number` (or `undefined`), but the type annotation in `Range.tsx` is `pushable?: boolean;`. When developing with `rc-slider` in Typescript, using for example `pushable={5}` causes a type error, and the only way around this is `pushable={(5 as unknown) as undefined}` which then produces the expected behaviour. This type annotation appears to be incorrect and would be great to have it updated. --- src/Range.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Range.tsx b/src/Range.tsx index bd85806f5..a2f15235a 100644 --- a/src/Range.tsx +++ b/src/Range.tsx @@ -39,7 +39,7 @@ export interface RangeProps extends GenericSliderProps { min?: number; max?: number; allowCross?: boolean; - pushable?: boolean; + pushable?: boolean | number; onChange?: (value: number[]) => void; onBeforeChange?: (value: number[]) => void; onAfterChange?: (value: number[]) => void;