Is there a way to use the Ternary Operator in the StyleSheet
?
Currently, my TextInput
looks as such:
.tsx
<TextInput
defaultValue={selectedEvent ? selectedEvent.title : ""}
style={[
styles.textInput,
{ color: colorScheme === "dark" ? "#ffffff" : "#000000" },
]}
onChangeText={inputChangeHandler}
/>
StyleSheet
const styles = StyleSheet.create({
textInput: {
borderBottomColor: "#ccc",
borderBottomWidth: 1,
marginBottom: 15,
paddingVertical: 4,
paddingHorizontal: 2,
},
})
It'd be nice not to combine internal and external styles.