mmarkelov / react-nouislider

React wrapper on NoUiSlider
https://mmarkelov.github.io/react-nouislider/
MIT License
60 stars 21 forks source link

defaultProps error #57

Open anzuj opened 5 months ago

anzuj commented 5 months ago

When running my React app with a <Nouislider/>, I get the below error in console:

Warning: v: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.

v^3.4.2",

Issue is caused by the defaultProps below: https://github.com/mmarkelov/react-nouislider/blob/master/src/index.js#L244

Would appreciate an update to avoid future problems regarding this.

skeppern commented 3 months ago

Upvoting on this. +1

antti5 commented 3 months ago

I'd like to second this.

I just upgraded from React 18.0 to React 18.2, and it calls console.error() on any use of defaultProps.

As a workaround I'm just manually filtering these from the console, but it's obviously less than ideal.