I have a React Native Expo project using TypeScript. How can I add types for the onChange
event for the TextInput
?
<TextInput
keyboardType="numeric"
value={`${value}`}
onChange={(e: React.FormEvent<HTMLInputElement>): void => {
set({ value: e.target.value });
}}
/>
I'm getting this error:
TS2339: Property "value" does not exist on type "EventTarget"