Typescript input onchange event.target.value

In my react and typescript app, I use: onChange={(e) => data.motto = (e.target as any).value} How do I correctly define the typings for the class, so I wouldn’t have to hack my way around the type system with any? export interface InputProps extends React.HTMLProps<Input> { … } export class Input extends React.Component<InputProps, {}> { } … Read more

How do I decide whether @types/* goes into `dependencies` or `devDependencies`?

I use TypeScript 2 in my project. I’d like to use some js library, but also typings for that library. I can install types with simple npm install @types/some-library. I’m not sure if I should –save or –save-dev them. It seems to me that even DefinetelyTyped GitHub readme kind of mentions both versions, but never … Read more