React native TouchableOpacity onPress Problems

You should bind a function that invokes your code.

For example:

<TouchableOpacity onPress={() => console.log('puff')} style={styles.burgerButton}>
  <Icon name="bars" style={styles.burgerIcon}/>
</TouchableOpacity>

A better way is to give it a reference to a component function

class SideIcon extends Component {
  handleOnPress = () => {
    console.log('puff')
  }
  render() {
    return (
      <TouchableOpacity onPress={this.handleOnPress} style={styles.burgerButton}>
        <Icon name="bars" style={styles.burgerIcon}/>
      </TouchableOpacity>
    );
  }
}