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

Type 'Color' is not assignable to type 'string'

$
0
0

I am using npm color package. I am completly new to typescript react-native. Here I am trying to use Color property on shadow color property something like this.

const BACKGROUND = "#88B04B";const Styles = StyleSheet.create({  topMorp: {    shadowOffset: {      width: -6,      height: -6,    },    shadowOpacity: 1,    shadowRadius: 6,    shadowColor: Color(BACKGROUND).lighten(0.5).alpha(0.5),  },

But here my code complains saying Type 'Color<ColorParam>' is not assignable to type 'string'. I don't know how to fix this any help would be great.


Viewing all articles
Browse latest Browse all 6212

Trending Articles



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