From 2d7ffc16d6f4cce8a74d2174416b65e2b8058c53 Mon Sep 17 00:00:00 2001 From: Sam Selikoff Date: Sun, 10 Aug 2014 16:47:06 -0400 Subject: [PATCH] Clarify section introducing callbacks --- docs/tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial.md b/docs/tutorial.md index 9d200427..fb826c1f 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -519,7 +519,7 @@ We use the `ref` attribute to assign a name to a child component and `this.refs` When a user submits a comment, we will need to refresh the list of comments to include the new one. It makes sense to do all of this logic in `CommentBox` since `CommentBox` owns the state that represents the list of comments. -We need to pass data from the child component to its parent. We do this by passing a `callback` in props from parent to child: +We need to pass data from the child component back up to its parent. We do this in our parent's `render` method by passing a new callback (`handleCommentSubmit`) into the child, binding it to the child's `onCommentSubmit` event. Whenever the event is triggered, the callback will be invoked: ```javascript{15-17,30} // tutorial17.js