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

How to cleanly create duplicate components with different parameters in react native/typescript?

$
0
0

I have a bunch of components that looks like this:

<View><Component   containerStyle={{ color: 'blue' }}   id={"test1"}   onPress={onPress1}/><Component   containerStyle={{ color: 'blue' }}   id={"test2"}   onPress={onPress2}/><Component   containerStyle={{ color: 'blue' }}   id={"test3"}   onPress={onPress3}/>  ...</View>

How can I create this cleanly in code without manually making a long list of these components?


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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