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

Type Script - React Native: " ViewStyle " type issue

$
0
0

When I pass the parameter:

defaultButtonTextDark: {     fontWeight: 'bold',     color: 'white',     fontSize: 16,   },

into ThemeManager function :

const ThemeManager = (darkStyle: ViewStyle, lightStyle: ViewStyle) => {  DO SOMETHING...}

So it shows me the following error:

Type '{ fontWeight: "bold"; color: string; fontSize: number; }' has no properties in common with type 'ViewStyle'.ts(2559).

way of use the function:

<Text style={ThemeManager(styles.defaultButtonTextDark, styles.defaultButtonText)}>return default</Text>

What is the way to solve this type issue ?


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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