From 921469f44e21ccca911e73b1cf2c97cdccb0e51f Mon Sep 17 00:00:00 2001 From: Morgan McLain-Smith Date: Thu, 20 Dec 2018 19:31:13 -0500 Subject: [PATCH] Minor typo fixes (#34063) * Minor typo fixes * fix: changed a to an --- .../react/create-a-controlled-input/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guide/english/certifications/front-end-libraries/react/create-a-controlled-input/index.md b/guide/english/certifications/front-end-libraries/react/create-a-controlled-input/index.md index 6c9e281daec..af3109ec0cc 100644 --- a/guide/english/certifications/front-end-libraries/react/create-a-controlled-input/index.md +++ b/guide/english/certifications/front-end-libraries/react/create-a-controlled-input/index.md @@ -16,12 +16,12 @@ handleChange(event) { } ``` -Now your next step will involve creating a input box and trigger it when someone types anything. Luckily we have a event called `onChange()` to serve this purpose.
+Now your next step will involve creating an input box and trigger it when someone types anything. Luckily we have an event called `onChange()` to serve this purpose.
PS - Here is another way to bind `this` into a function ``` ``` -But this just won't serve your purpose. Although you might feel that its working. So what's happening here is text updates from from the browser not the state. So to correct this we'll add a `value` attribute and set it to `this.state.input` to the input element which will make the input get controlled by state. +But this just won't serve your purpose. Although you might feel that its working. So what's happening here is text updates from the browser not the state. So to correct this we'll add a `value` attribute and set it to `this.state.input` to the input element which will make the input get controlled by state. ``` @@ -32,4 +32,4 @@ It can be a bit hard to digest but to make things further clear try removing the ``` Now run the tests again are you able to type anything?
-The answer to it will be "NO" since your input box is getting value from the state variable `input` since there is no change in the state `input`(an empty string initially) which will only happen when you trigger the function `handleChange()` which will only happen when you have a event handler like `onChange()` hence the string inside the input box will remain as it is i.e, an empty string. +The answer to it will be "NO" since your input box is getting value from the state variable `input` since there is no change in the state `input`(an empty string initially) which will only happen when you trigger the function `handleChange()` which will only happen when you have an event handler like `onChange()` hence the string inside the input box will remain as it is i.e, an empty string.