omgovich / react-colorful

🎨 A tiny (2,8 KB) color picker component for React and Preact apps
https://omgovich.github.io/react-colorful
MIT License
3.19k stars 100 forks source link

...rest props not typescript interference #217

Open alex-frx opened 4 months ago

alex-frx commented 4 months ago

Hey like the title Typescript is not working with rest props and spread operator.

Example:

export function ColorPicker({...rest}) {
    return <HexColorPicker className={"your-component"}  {...rest}/>;
}

If u use this component typescript cant figure out the types. Example usage:

<ColorPicker color={backColor} onChange={(color) => {
                setBackColor(color)}}
/>