Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6211

TypeScript types for TextInput's onChange event in React Native

$
0
0

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"


Viewing all articles
Browse latest Browse all 6211

Trending Articles