samedi 21 février 2015

How to update state of parent's parent component in react?


I'm playing around with fb's tutorial on comment box. Let's imagine I've added functionality to delete comments, so I will have something like this in Comment component -



onClick={this.handleCommentDelete}


How do I trigger change of the state of the commentBox parent component without propagating callback throughout commentList component and then to comment component?



<commentBox>
<commentList>
<comment>




Aucun commentaire:

Enregistrer un commentaire