W moim reagować i maszynopis aplikacji, używam: onChange={(e) => data.motto = (e.target as any).value}.
Jak poprawnie zdefiniować typy dla klasy, aby nie musieć hakować systemu typów any?
export interface InputProps extends React.HTMLProps<Input> {
...
}
export class Input extends React.Component<InputProps, {}> {
}
Jeśli wstawię target: { value: string };otrzymam:
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'.
