Skip to content

onClick on button throws Typescript error #10

Description

@victorcarvalhosp

Hi! First I would like to say thank you for doing such a so nice project!

I'm having an issue when I'm trying to add an onClick to a Button component. I'm trying to do it like this:

<Button primary className="advance-button" onClick={onClickContinue}>Continue</Button>

And I'm getting this error message:

Type '{ children: string; primary: true; className: string; onClick: () => void; }' is not assignable to type 'IntrinsicAttributes & ButtonProps & { children?: ReactNode; }'.
Property 'onClick' does not exist on type 'IntrinsicAttributes & ButtonProps & { children?: ReactNode; }'. TS2322

I believe we should be able to use onClick on Buttons. If I'm doing something wrong please let me know!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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