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

onClick on button throws Typescript error

Open victorcarvalhosp opened this issue 5 years ago • 0 comments

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!

victorcarvalhosp avatar Jan 25 '20 14:01 victorcarvalhosp