Skip to content

...rest props not typescript interference  #217

Open
@alex-frx

Description

@alex-frx

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)}}
/>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions