These type definitions break even the code from the docs with the following error:
onClick won't let my code compile, so for now I had to suppress the error.
Here's why it breaks. HTMLButtonElement is an interface describing a vanilla DOM button element. So it has a lowercased onclick and a whole lot of other required fields (about 300 of them) which you will need to specify in order to get your code to compile.
What's in the PR
I updated the d.ts-file and used the interface which React itself uses for buttons.
It has a normal React-style onClick and other optional fields relevant for buttons and the inherited ones.
The problem
Here's the
index.d.ts
code currently in themaster
:These type definitions break even the code from the docs with the following error:
onClick
won't let my code compile, so for now I had to suppress the error.Here's why it breaks.
HTMLButtonElement
is an interface describing a vanilla DOMbutton
element. So it has a lowercasedonclick
and a whole lot of other required fields (about 300 of them) which you will need to specify in order to get your code to compile.What's in the PR
I updated the d.ts-file and used the interface which React itself uses for buttons. It has a normal React-style
onClick
and other optional fields relevant for buttons and the inherited ones.