From bf5abdf14f55b7f961097b48f78ee4ca7514fed4 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 12 Mar 2017 08:29:10 -0700 Subject: [PATCH 01/14] Remove ref usage in main markdown example (#9160) from [elsewhere in the docs](https://facebook.github.io/react/docs/refs-and-the-dom.html): > Avoid using refs for anything that can be done declaratively. --- docs/_js/examples/markdown.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/_js/examples/markdown.js b/docs/_js/examples/markdown.js index 696074cd65..f0cab2b8b0 100644 --- a/docs/_js/examples/markdown.js +++ b/docs/_js/examples/markdown.js @@ -6,8 +6,8 @@ class MarkdownEditor extends React.Component { this.state = {value: 'Type some *markdown* here!'}; } - handleChange() { - this.setState({value: this.refs.textarea.value}); + handleChange(e) { + this.setState({value: e.target.value}); } getRawMarkup() { @@ -21,7 +21,6 @@ class MarkdownEditor extends React.Component {

Input

+ , ); }).toThrow(); @@ -350,8 +359,8 @@ describe('ReactDOMTextarea', () => { ReactTestUtils.renderIntoDocument(