hxf31891 / react-gradient-color-picker

An easy to use color/gradient picker for React.js
MIT License
126 stars 39 forks source link

TypeScript error on onChange with latest version 2.3.3 #73

Closed sytolk closed 6 months ago

sytolk commented 7 months ago

This error happened after upgrade from v2.3.2 to v2.3.3

extensions/tagspacespro/modules/components/CustomBackgroundDialog.tsx:117:13 - error TS2322: Type '(newColor: any) => void' is not assignable to type '() => void'.
  Target signature provides too few arguments. Expected 1 or more, but got 0.

117             onChange={(newColor) => setColor(newColor)}
                ~~~~~~~~

  node_modules/react-best-gradient-color-picker/lib/components/index.d.ts:3:5
    3     onChange?: (() => void) | undefined;
          ~~~~~~~~
    The expected type comes from property 'onChange' which is declared here on type 'IntrinsicAttributes & { value?: string; onChange?: () => void; hideControls?: boolean; hideInputs?: boolean; hideOpacity?: boolean; hidePresets?: boolean; hideHue?: boolean; ... 14 more ...; className: any; }'
zerosoul commented 7 months ago

+1

hxf31891 commented 7 months ago

@zerosoul @sytolk Sorry gentlemen, thats a big oversight on my part. Should be fixed in 2.3.4. Would appreciate if either of you can confirm, I was not able to reproduce.