react-slider icon indicating copy to clipboard operation
react-slider copied to clipboard

Add support for react 19

Open captain-igloo opened this issue 1 year ago • 6 comments

react 19 is not supported

captain-igloo avatar Dec 17 '24 01:12 captain-igloo

react 19 is not supported

Yes, I have got problems after migration to React 19 too.

There were errors during the build, and some troubles with ReactSlider component.

 Its type 'typeof ReactSlider' is not a valid JSX element type.
  Type 'typeof ReactSlider' is not assignable to type 'new (props: any) => Component<any, any, any>'. 
    Construct signature return types 'ReactSlider<any>' and 'Component<any, any, any>' are incompatible.
      The types returned by 'render()' are incompatible between these types.
         Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'.
              Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'.

Please fix its :)

vladboss61 avatar Dec 17 '24 14:12 vladboss61

I guess it's related:

react-jsx-runtime.development.js?bb19:87 Warning: A props object containing a "key" prop is being spread into JSX ... /node_modules/react-slider/dist/es/dev/components/ReactSlider/ReactSlider.mjs:123:30

I get this on React v18.3, which is to make migration to v19 easier. It shows all the deprecated stuff, but still works

Basically it says, instead of:

const props = {
  key: id,
  className: "my-class",
}

return <Component {...props} />

Needs to be:

const props = {
  className: "my-class",
}

return <Component key={id} {...props} />

Karmalakas avatar Dec 19 '24 17:12 Karmalakas

I need also support for react 19

GenGraphic avatar Jan 13 '25 09:01 GenGraphic

I am not sure this project is maintained anymore. Nothing happened for 2 years.

m10 avatar Jan 21 '25 12:01 m10

Any way around this or a suitable alternative?

nonybrighto avatar Jul 05 '25 19:07 nonybrighto

Hi @nonybrighto, You’re currently using an alternative package to react-slider => specifically, rc-slider. This is a well-maintained and reliable package that serves as a suitable alternative. It provides similar functionality and is actively maintained, making it a good choice for most use cases.

ct-dixit avatar Jul 14 '25 04:07 ct-dixit