From 004db11878100657ad0c6c85a5627bb386069da3 Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Mon, 14 Apr 2014 16:22:04 -0700 Subject: [PATCH] Update refs example code to use onChange Fixes #1408. Test Plan: Copy each code snippet into jsbin; type in the text box successfully; click the button and see the input clear (and in the second example, get focused). --- docs/07.1-more-about-refs.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/07.1-more-about-refs.md b/docs/07.1-more-about-refs.md index e6020f336..70179ee44 100644 --- a/docs/07.1-more-about-refs.md +++ b/docs/07.1-more-about-refs.md @@ -15,7 +15,7 @@ Consider the case when you wish to tell an `` element (that exists with getInitialState: function() { return {userInput: ''}; }, - handleKeyUp: function(e) { + handleChange: function(e) { this.setState({userInput: e.target.value}); }, clearAndFocusInput: function() { @@ -30,7 +30,7 @@ Consider the case when you wish to tell an `` element (that exists with ); @@ -91,7 +91,7 @@ It's as simple as: getInitialState: function() { return {userInput: ''}; }, - handleKeyUp: function(e) { + handleChange: function(e) { this.setState({userInput: e.target.value}); }, clearAndFocusInput: function() { @@ -107,7 +107,7 @@ It's as simple as: );