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

The defaultProps in function components will be removed in a future version of React.

Open soyeon9211 opened this issue 1 year ago • 4 comments

Hello, the library is using has code that utilizes defaultProps, which is causing my console to be cluttered with warnings. Since defaultProps will soon be deprecated, it needs to be updated.

스크린샷 2024-09-02 오후 1 28 34 스크린샷 2024-09-02 오후 1 28 51

soyeon9211 avatar Sep 02 '24 04:09 soyeon9211

same issue here!

fabienrohrer avatar Sep 02 '24 11:09 fabienrohrer

It's due to the use of ´defaultProps´ here:

https://github.com/casesandberg/react-color/blob/bc9a0e1dc5d11b06c511a8e02a95bd85c7129f4b/src/components/circle/Circle.js#L51

A solution is certainly to use default parameter instead of defaultProps everywhere:

export const Circle = ({
  width = 252,
  onChange = undefined,
  // etc.

It seems this repo is not maintained. I fear that creating a patch is a waste of time...

fabienrohrer avatar Sep 02 '24 11:09 fabienrohrer

Same issue was mentioned here https://github.com/casesandberg/react-color/issues/903. Looks like there's a PR for this already https://github.com/casesandberg/react-color/pull/893 but there's no maintainers https://github.com/casesandberg/react-color/issues/928.

Any suggestions?

emersonbroga avatar Sep 05 '24 09:09 emersonbroga

This repo appears to be abandoned. I switched to @uiw/react-color and it fixed this issue.

bfeist avatar Feb 02 '25 17:02 bfeist