5 Answers
we can create a enum like property as below:
const adminEnum = { Admin: 'Admin'};
Hope I got the question right.
1
-
This is not a type. The answer below is thus a better choice in typescript (stackoverflow.com/a/65108763/9611924)
– bieboebapSep 7, 2022 at 13:00
you can use enum with typeScript
in react-native
like describe in the link
sample code is
enum Direction {
Up = 1,
Down,
Left,
Right,
}