Entrada datilografada onchange event.target.value
No meu aplicativo react e typcript, eu uso:onChange={(e) => data.motto = (e.target as any).value}
.
Como defino corretamente as digitações para a classe, para não precisar percorrer o sistema de tipos comany
?
export interface InputProps extends React.HTMLProps<Input> {
...
}
export class Input extends React.Component<InputProps, {}> {
}
Se eu colocartarget: { value: string };
Eu recebo :
ERROR in [default] /react-onsenui.d.ts:87:18
Interface 'InputProps' incorrectly extends interface 'HTMLProps<Input>'.
Types of property 'target' are incompatible.
Type '{ value: string; }' is not assignable to type 'string'.