React Native pass parameters through map function
In both cases you are unnecessarily wrapping item
in {}. For both of these lines, the expressions inside the outer {} are pure javascript (an array and a function) and should follow javascript syntax.
So the lines should read as follows:
style={[styles.button, (this.state.location===item && styles.buttonPressed)]}
and
onPress={()=>this.buttonPress(item)}