title: How to hide view in react native
body: <p>new to react native cleary. Struggling to hide a view. I'm trying to onclick of a TouchableWithoutFeedback to change the opacity of a view. I'm using this.state to try and do this but no matter what I set on state it can't be found in the gotoNext function</p>
  
  <pre><code>export default class MainView extends Component
  {
    constructor(props) {
      super(props);
      this.state = {hideInfo:false,infoOpacity:0.75};
    }
  
    onTap(){
      console.log("tap tap");
      this.setState({hideInfo:!this.state.hideInfo});
      if(this.state.hideInfo)
      {
        this.setState({infoOpacity:0});
      }else{
        this.setState({infoOpacity:0.75});
      }
    };
  
    render()
    {
      var pages = []
      for (var i = 65; 90 &gt;= i; i++) {// A-65, Z-90
        c = String.fromCharCode(i);
        var letters = []
        customData.pages.forEach(function(meow){
          if(meow.letter.toUpperCase() == c)
          {
            letters.push(meow);
          }
        });
  
        var ranPage = letters[Math.floor(Math.random() * letters.length)];
        const window = Dimensions.get('window');
        if(ranPage){
          pages.push(
              &lt;View key={1}&gt;
              &lt;TouchableWithoutFeedback onPress={this.onTap.bind(this)}&gt;
                &lt;Image source={{uri: ranPage.image}} style={{width: window.width, height: window.height}} /&gt;
              &lt;/TouchableWithoutFeedback&gt;
                  &lt;View style={[styles.meow, {opacity: this.state.infoOpacity}]}&gt;
                    &lt;Text style={styles.text}&gt;{ranPage.name}&lt;/Text&gt;
                    &lt;Text style={styles.text}&gt;{ranPage.phonetic}&lt;/Text&gt;
                    &lt;Text style={styles.text2}&gt;{ranPage.description}&lt;/Text&gt;
                  &lt;/View&gt;
              &lt;/View&gt;
          )
        }else{
          console.log(c)
        }
  }
  
      return (
        &lt;Swiper style={styles.wrapper} showsButtons={true}&gt;
          {pages}
        &lt;/Swiper&gt;
      );
    }
  }
  </code></pre>