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

react native : What is the way to create an enum with 3 color types?

$
0
0

In my example I try add a variable button_gradient_color with 3 parameters of color and it shows an error.The error is:Enum member must have initializer

What is the way to create an enum with 3 color types ?

export enum Colors { background_color = '#000060', button_gradient_color = '#4c669f', '#3b5998', '#192f6a'};

this is the LinearGradient

<LinearGradient            colors={ Colors.button_gradient_color1,Colors.button_gradient_color2,Colors.button_gradient_color3}>

Viewing all articles
Browse latest Browse all 6287

Trending Articles



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