In my react and typescript app, I use: onChange={(e) => data.motto = (e.target as any).value}.
onChange={(e) => data.motto = (e.target as any).value}
How do I correctly define the typings for the class, s
Here is a way with ES6 object destructuring, tested with TS 3.3. This example is for a text input.
name: string = ''; private updateName({ target }: { target: HTMLInputElement }) { this.name = target.value; }