title: Updating post count the reactive way
body: <p>I am new to react. I have created a news component that consumes a json url then spits out some news articles. In the client side UI if the clients changes the json url it will update without refreshing the page using this code:</p>
  
  <pre><code>componentDidUpdate(prevProps) {
     if (prevProps.jsonUrl !== this.props.jsonUrl) {
         this.getPosts();
     }
  }
  </code></pre>
  
  <p>However I also need the the news feed to update reactively if the      postCount: this.props.postCount is changed in the client side UI. The post count is used in the render method below to choose how many posts to display.</p>
  
  <pre><code>posts
      .slice(0, postCount)
      .map(post =&gt; {
          // Variables to use
          let { id, name, summary, url, imgUrl} = post;
          // Stripping html tags from summary
          //let strippedSummary = summary.replace(/(&lt;([^&gt;]+)&gt;)/ig,"");
          // What we actually render
          return (
              &lt;div key={id} className={ styles.post}&gt;
                  &lt;p&gt;{name}&lt;/p&gt;
                  {/* &lt;p&gt;{summary}&lt;/p&gt; */}
                  &lt;a href={url}&gt;{url}&lt;/a&gt;
                  &lt;img className={ styles.postImage} src={imgUrl} /&gt;
              &lt;/div&gt;
          );
      })
  </code></pre>
  
  <p>Any help is much appreciated! - I was thinking something like this inside <em>componentDidUpdate</em>:</p>
  
  <pre><code>if (prevProps.postCount !== this.props.postCount) {
      this.setState( this.state.postCount; );
  }
  </code></pre>
  
  <p>EDIT: </p>
  
  <p>I am now using the postCount from the props instead of a state and it updates instantly! :D</p>
  
  <pre><code>// Grabbing objects to use from state
  const { posts, isLoading } = this.state;
  const { postCount } = this.props;
  </code></pre>