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

ts enum not working Argument of type '"MALE"' is not assignable to parameter of type 'Gender | (() => Gender | null) | null

$
0
0

I want to use ENUM but I got this error message:

Argument of type '"MALE"' is not assignable to parameter of type 'Gender | (() => Gender | null) | null

Code:

enum Gender {  MALE = 'MALE',  FEMALE = 'FEMALE',};  const [gender, SetGender] = useState<Gender | null>('MALE');```

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>