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
An alternative that has not been mentioned yet is to type the onChange function instead of the props that it receives. Using React.ChangeEventHandler:
const stateChange: React.ChangeEventHandler = (event) => { console.log(event.target.value); };