You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript shows an error when implement the Radio Buttons-example from the docs: Property 'value' does not exist on type 'EventTarget'. or Type '(event: ChangeEvent<HTMLInputElement>, value: string) => void' is not assignable to type '(event: ChangeEvent<{}>, value: string) => void'
This is not a v0.x issue.
I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
The handleChange-event for RadioGroup and FormControlLabel should include the HTMLInputElement-type: (event: React.ChangeEvent<HTMLInputElement>, value: string) => void; and (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
Current Behavior
Currently it is implemented via event: React.ChangeEvent<{}>, which does not include a value-prop.
It is implemented with an arrow function, since Sandbox displays the error here, but the implementation with a class function also results in an error (codesandbox swallows this error):
Context
Your Environment
Tech
Version
Material-UI
v3.1.1
React
16.5.2
TypeScript
3.0.3
(By the way, you could change the issue-template, currently "v1.?.?" is prefilled, but "v3.?.?" would make more sense I think? ;-) )
The text was updated successfully, but these errors were encountered:
TypeScript shows an error when implement the Radio Buttons-example from the docs:
Property 'value' does not exist on type 'EventTarget'.
orType '(event: ChangeEvent<HTMLInputElement>, value: string) => void' is not assignable to type '(event: ChangeEvent<{}>, value: string) => void'
Expected Behavior
The
handleChange
-event for RadioGroup and FormControlLabel should include the HTMLInputElement-type:(event: React.ChangeEvent<HTMLInputElement>, value: string) => void;
and(event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
Current Behavior
Currently it is implemented via
event: React.ChangeEvent<{}>
, which does not include avalue
-prop.Steps to Reproduce
Link: sandbox (see
onChange
of the<RadioGroup>
)It is implemented with an arrow function, since Sandbox displays the error here, but the implementation with a class function also results in an error (codesandbox swallows this error):
Context
Your Environment
(By the way, you could change the issue-template, currently "v1.?.?" is prefilled, but "v3.?.?" would make more sense I think? ;-) )
The text was updated successfully, but these errors were encountered: