slider icon indicating copy to clipboard operation
slider copied to clipboard

Received `false` for a non-boolean attribute `dragging`.

Open Bernabe-Felix opened this issue 6 years ago • 4 comments

Handle is passing a boolean property to the generated div

screen shot 2018-11-28 at 1 01 33 pm

Bernabe-Felix avatar Nov 28 '18 19:11 Bernabe-Felix

@Bernabe-Felix The problem is a boolean is being passed as the dragging prop, when it is asking for a string. A temporary fix that we found is to wrap Handle in a function that returns it with a modified dragging prop. Something like this can be incorporated into a component:

import Slider, { Handle } from 'rc-slider';

const HandleWrapper = props => {
  const { dragging, ...restProps } = props;

  return (
    <React.Fragment>
      <Handle dragging={dragging.toString()} {...restProps} />
    </React.Fragment>
  );
};

... a lot of code skipped ...

<Slider
  handle={HandleWrapper}
/>

edplato avatar Jan 09 '19 22:01 edplato

I'm getting similar error with version 8.7.0 for reverse attribute

image

kiran8910 avatar Sep 05 '19 23:09 kiran8910

Take a look at line: const { dragging, ...restProps } = props;. props should be unwrapped instead of passing them directly like: <Handle dragging={props.dragging.toString()} {...props} />

In the other words, you can't skip const { dragging, ...restProps } = props;.

twistezo avatar Dec 15 '20 16:12 twistezo

but now when you do that you get the following error , looks like the types are wrong and not expecting dragging , if i don't put it it works fine the types don't complain but on the console we get that error image

javierfuentesm avatar Sep 13 '22 16:09 javierfuentesm