From 692ca14f0c4e6e48eed946cb2442281af9d745ba Mon Sep 17 00:00:00 2001 From: Daniela Borges Matos de Carvalho Date: Fri, 27 Oct 2017 11:17:51 +0100 Subject: [PATCH 1/2] Update test-utils to use refs correctly Update test-utils according to the new way of using refs: https://reactjs.org/docs/refs-and-the-dom.html --- content/docs/addons-test-utils.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/docs/addons-test-utils.md b/content/docs/addons-test-utils.md index d83be3e611e..93dd620ce42 100644 --- a/content/docs/addons-test-utils.md +++ b/content/docs/addons-test-utils.md @@ -66,16 +66,16 @@ Simulate an event dispatch on a DOM node with optional `eventData` event data. **Clicking an element** ```javascript -// -const node = this.refs.button; +// const node = this.button; ReactTestUtils.Simulate.click(node); ``` @@ -74,7 +74,7 @@ ReactTestUtils.Simulate.click(node); **Changing the value of an input field and then pressing ENTER.** ```javascript -// this.textInput = input} /> +// this.textInput = node} /> const node = this.textInput; node.value = 'giraffe'; ReactTestUtils.Simulate.change(node);