title: Comments won't reload with new props?
body: <p>I'm having some trouble with updating some props. My app has a feed screen (listView) of posts (listItems). I’m also using redux.</p>
  
  <p>If I click on a post, it'll take me to the comments screen. As it does so, it passes through the props of the listItem and fully displays the post text, image, author etc.</p>
  
  <p>When in the commentScreen, If I click on the content (image/text), it'll take me through to the editPost screen. As it does this, it takes the props (image/text/uid) and populates the textInput and image field so the user can edit it. When done, I can click the saveEdit button. This will take the text, image and uid and update the post within firebase via an action. It will also pop() the screen and take me back to the commentsScreen.</p>
  
  <p>The problem is, the edited post can't be seen. The original text/image is still there. If I look in my Firebase console, I can see that the edit HAS been saved.</p>
  
  <p>If I pop the commentsScreen and go back to the feed,  it's up to date. I can see that the post has been successfully edited. If I then click on the post again, it'll take me back to the commentsScreen, showing the updated post.</p>
  
  <p>I guess this is because the listView in the feed itself is watching the firebase reference for the posts? and as such the post in the commentScreen won't change until I revisit the feed so it can update?</p>
  
  <p>How can I work around this? Do I need to be doing something with componentWillUpdate or componentWillReceiveProps or something?</p>
  
  <p>I have tried firing different get requests to firebase at different points but I've had no success so far.</p>
  
  <p>This is my Feed:</p>
  
  <pre><code>class FeedComponent extends Component {
    componentWillMount() {
      this.props.postsFetch();
  
      this.createDataSource(this.props);
    }
  
    componentWillReceiveProps(nextProps) {
      // nextProps are the next set of props that this component
      // will be rendered with
      // this.props is still the old set of props
      this.createDataSource(nextProps);
    }
  
    createDataSource({ posts }) {
      const ds = new ListView.DataSource({
        rowHasChanged: (r1, r2) =&gt; r1 !== r2
      });
  
      this.dataSource = ds.cloneWithRows(posts);
    }
  
    renderRow(posts) {
      return &lt;PostListItem posts={posts} /&gt;;
    }
  
    render() {
      return (
          &lt;ListView
            {...this.props}
            enableEmptySections
            removeClippedSubviews={false}
            dataSource={this.dataSource}
            renderRow={this.renderRow}
            style={{ backgroundColor: '#D8D8D8' }}
          /&gt;
        );
      }
    }
  
  
  const mapStateToProps = state =&gt; {
    const posts = _.map(state.feed, (val, uid) =&gt; {
      return { ...val, uid };
    });
  
    return { posts };
  };
  
  export default connect(mapStateToProps, { postsFetch })(FeedComponent);
  </code></pre>
  
  <p>This then performs this action:</p>
  
  <pre><code>export const postsFetch = () =&gt; {
    return (dispatch) =&gt; {
      firebase.database().ref('/social/posts')
        .on('value', snapshot =&gt; {
            dispatch({ type: POSTS_FETCH_SUCCESS, payload: snapshot.val() });
        });
    };
  };
  </code></pre>
  
  <p>and dispatches it to the reducer.</p>
  
  <p>Here is the listItem:</p>
  
  <pre><code>@withNavigation
  class PostItem extends Component {
    state = {
      result: ''
    };
  
    goToComments() {
      this.props.navigation
       .getNavigator('root')
       .push(Router.getRoute('comments', { posts: this.props.posts }));
    }
  
    render() {
      const {
        text,
        author,
        vote_count,
        comment_count,
        image,
        created_at
      } = this.props.posts;
  
      const fromNow = moment(created_at).fromNow();
  
      return (
        &lt;Card style={styles.cardStyle}&gt;
  
          &lt;TouchableOpacity onPress={this.goToComments.bind(this)}&gt;
           //Text/Image component using props
          &lt;/TouchableOpacity&gt;
        &lt;/Card&gt;
      );
    }
  }
  </code></pre>
  
  <p>There, you can see that there's an goToComments function, it passes the post props</p>
  
  <p>This is the comment screen:</p>
  
  <pre><code>class Comments extends Component {
    render() {
      return (
        &lt;View style={{ flex: 1 }}&gt; 
           &lt;PostSection
              post={this.props.route.params.posts}
            /&gt;
        &lt;/View&gt;
      );
    }
  }
  </code></pre>
  
  <p>This feeds the props into the postSection component which displays the post in the comments screen. It is this that doesn't update after I go to the edit screen, make the edit and come back:</p>
  
  <pre><code>@withNavigation
  class PostSection extends Component {
    editPost() {
      this.props.startEdit(this.props.post);
  
      this.props.navigation
       .getNavigator('root')
       .push(Router.getRoute('editPost'));
    }
  
    renderImage(image) {
      if (image) {
        return (
          &lt;View style={styles.imageContainer}&gt;
            &lt;Image
              style={styles.imageSize}
              source={{ uri: image }}
            /&gt;
          &lt;/View&gt;
        );
      }
    }
  
    renderText(text) {
      if (text) {
        return &lt;PostText text={text} /&gt;;
      }
    }
  
    renderPost(text, image) {
      // if (POST BELONGS TO CURRENT USER) {
          return (
            &lt;TouchableOpacity onPress={this.editPost.bind(this)}&gt;
              {this.renderText(text)}
  
              {this.renderImage(image)}
            &lt;/TouchableOpacity&gt;
          );
    }
  
    render() {
      const {
        text,
        author,
        vote_count,
        comment_count,
        image,
        created_at
      } = this.props.post;
  
      const fromNow = moment(created_at).fromNow();
  
      return (
        &lt;View&gt;
          &lt;TopBar
            author={author}
            fromNow={fromNow}
          /&gt;
  
          {this.renderPost(text, image)}
  
          &lt;BottomBar
            voteCount={vote_count}
            commentCount={comment_count}
          /&gt;
        &lt;/View&gt;
      );
    }
  }
  
  export default connect(null, { startEdit })(PostSection);
  </code></pre>