title: React Native JSX: Setting state causes app to crash
body: <p>I am using react native to build my app. Below is the code I am using to display a list of 'tags'. So the code is used to hide all the tags except for the first 2, and a 'load more' link will appear. Clicking on the load more link is supposed to show the rest of the tags. However the code crashes on me.</p>
  
  <pre><code>this.state = {
    visibleCount: 2,
  };
  
  &lt;TextLink onPress={() =&gt; {
      this.setState({visibleCount: mealTags.length});
    }}
  &lt;/TextLink&gt;
  </code></pre>
  
  <p>I am using changing to state to show the tags. Can anyone advise me on what went wrong and how I can update it?</p>
  
  <pre><code>export function MealTagsSection(props: MealTagsProps) {
    let {mealTags} = props;
    let loadMoreLink;
  
    if (mealTags.length &gt; 2) {
      loadMoreLink = (
        //THIS CAUSES THE APP TO CRASH
        &lt;TextLink onPress={() =&gt; {
          this.setState({visibleCount: mealTags.length});
        }}
        &gt;
          load more...
        &lt;/TextLink&gt;
      );
    } else {
      loadMoreLink = null;
    }
  
    this.state = {
      visibleCount: 2,
    };
  
    return (
      &lt;View style={styles.mealTagsContainer}&gt;
        {
          mealTags.slice(0, this.state.visibleCount).map((mealTag) =&gt; {
            let tagStyle = '';
            if (mealTag.category === 1) {
              tagStyle = styles.tag_healthy;
            } else {
              tagStyle = styles.tag_improve;
            }
            return (
              &lt;View style={tagStyle}&gt;
                &lt;Text style={styles.tagText}&gt;{mealTag.description}&lt;/Text&gt;
              &lt;/View&gt;
            );
          })
        }
        {loadMoreLink}
      &lt;/View&gt;
    );
  }
  </code></pre>
  
  <p>The error I am getting is this:
  *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: t.setState is not a function. (In 't.setState({visibleCount:n.length})', 't.setState' is undefined)', reason: 'Unhandled JS Exception: t.setState is not a function. (In 't.setState({visi..., stack: onPress@439:2034</p>