I have a component that has:
{ tSlots.map((time, index) => <TouchableOpacity onPress={() => { var pieces = time.split(':') hour = parseInt(pieces[0], 10); minute = parseInt(pieces[1], 10); selectTimeHandler(hour, minute) }}> <Text style={[styles.timeText, { color: WHAT_TO_DO_HERE }]} key={index}>{time}</Text> </TouchableOpacity> ) }
tSlots
is an array that has time slots in string. I don't know how to change the color of text I've marked it WHAT_TO_DO_HERE
in the code snippet above.
没有评论:
发表评论