I don’t know if I am making a syntax error or if the logic is wrong here, however I am trying to use the functions parameter to give this component a background color.
My function:
function CreateTouchables({text}, {colour}) {
return (
<TouchableOpacity style={[buttons.buttonSize, {backgroundColor: {colour}}]}>
<Text style={[buttons.text, {fontSize: 40}]}>
{text}
</Text>
</TouchableOpacity>
)
}
Where the function is being called
<View style={[style.operators, style.general, style.bottomPadding]}>
<CreateTouchables text={'/'} colour='orange'/>
<CreateTouchables text={'X'} colour='orange'/>
<CreateTouchables text={'-'} colour='orange'/>
<CreateTouchables text={'+'} colour='orange'/>
<CreateTouchables text={'='} colour='orange'/>
</View>