Version
- rc-slider: @9.3.0
- node: v10.16.0
- npm: 6.9.0
- Browser: chrome
Steps to reproduce
- import Slider from ‘rc-slider’;
- use it as controlled component like
<Slider value={value} onChange={handleSliderChange} />
What is actually happening?
- it posts errors like that
error TS2607: JSX element class does not support attributes because it does not have a 'props' property.
error TS2786:'Slider' cannot be used as a JSX component.
Its instance type '{ [x: string]: any; componentDidMount(): void; componentWillUnmount(): void; onMouseDown: (e: any) => void; onTouchStart: (e: any) => void; onFocus: (e: any) => void; onBlur: (e: any) => void; onMouseUp: () => void; ... 16 more ...; render(): Element; }' is not a valid JSX element.
Type '{ [x: string]: any; componentDidMount(): void; componentWillUnmount(): void; onMouseDown: (e: any) => void; onTouchStart: (e: any) => void; onFocus: (e: any) => void; onBlur: (e: any) => void; onMouseUp: () => void; ... 16 more ...; render(): Element; }' is missing the following properties from type 'ElementClass': context, setState, forceUpdate, props, and 2 more.
have got same issue… v9.2.4 is worked.
@OhadTutay downgrade to v9.2.4 worked for me.
Same here.
I will handle this problem.
Same here for Slider & Range; worked with v9.2.4 and not with 9.3.0. Seems to come from the *.d.ts files which are now in v9.3.0 which conflict with the @types/rc-slider mappings. Removing the @types/rc-slider does not seem to work though.
Fixed in https://github.com/react-component/slider/releases/tag/v9.5.0
@MasterCassim can always override I suppose. It is more manual work, but at least it works without downgrading