From 77cea317dc3ff07f95ddbc90319c1afd926b3986 Mon Sep 17 00:00:00 2001 From: whurley Date: Tue, 19 Nov 2019 12:31:39 -0800 Subject: [PATCH 1/2] Update NouisliderProps.tooltips typing to match noUiSlider docs --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index dea7804..cd6f9ae 100644 --- a/index.d.ts +++ b/index.d.ts @@ -41,7 +41,7 @@ export interface NouisliderProps { start: number | number[] | string | string[]; step?: number; style?: React.CSSProperties; - tooltips?: boolean | object[]; + tooltips?: boolean | (boolean | Formatter)[]; } export default class Nouislider extends React.Component {} From 78dc5fcd9869214ac6d10de34743eb0a3a304d1e Mon Sep 17 00:00:00 2001 From: whurley Date: Tue, 19 Nov 2019 14:54:31 -0800 Subject: [PATCH 2/2] Update Tooltips description on github.io page and PropTypes in index.js --- example/src/components/Options.js | 2 +- src/index.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/example/src/components/Options.js b/example/src/components/Options.js index 0550988..768b3c3 100644 --- a/example/src/components/Options.js +++ b/example/src/components/Options.js @@ -31,7 +31,7 @@ const Options = () => ( DIRECTION - Accepted values : ltr, rtl
  • - TOOLTIPS - Accepted values : false, true, formatter, + TOOLTIPS - Accepted values : false, true, array[formatter or true or false, ...]
  • diff --git a/src/index.js b/src/index.js index f5fe572..18935ba 100644 --- a/src/index.js +++ b/src/index.js @@ -206,7 +206,9 @@ Nouislider.propTypes = { tooltips: PropTypes.oneOfType([ PropTypes.bool, PropTypes.arrayOf( + PropTypes.bool, PropTypes.shape({ + from: PropTypes.func, to: PropTypes.func }) )