react-input-range icon indicating copy to clipboard operation
react-input-range copied to clipboard

Suggestion for type improvement

Open Arasid opened this issue 6 years ago • 0 comments

Hi, I would like to suggest changing types to something similar as:

export interface InputRangeProps<T extends Range | number> {
  ...
  onChange: (value: T) => void;
  onChangeStart?: (value: T) => void;
  onChangeComplete?: (value: T) => void;
  value: T;
}

export default class InputRange<T extends Range | number> extends React.Component<InputRangeProps<T>, any> {}

It would be a great help. e.g. when implementing onChange method, where typescript forces me to write code for both number and range case, even though based on value, the other case will never happen ...

Thank you for this project!

Arasid avatar Sep 26 '19 13:09 Arasid