From 25730a92ac5a9f4e17fbfa7af3904662b121a301 Mon Sep 17 00:00:00 2001 From: Stefan <42074868+stefanhk31@users.noreply.github.com> Date: Tue, 12 Feb 2019 11:07:45 -0500 Subject: [PATCH] Edited copy for grammar/flow (#26155) I went through the text to fix some minor grammatical issues (eg, it's/its) and make the text descriptions flow better. I also added some extra code sections to clearly mark where there is code that will be typed into the editor. --- guide/english/react/index.md | 72 ++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/guide/english/react/index.md b/guide/english/react/index.md index 8a0a069789..de7452c616 100644 --- a/guide/english/react/index.md +++ b/guide/english/react/index.md @@ -47,25 +47,25 @@ ReactDOM.render( ); ``` -2. React is Declarative for most part in which we are concerned more with What to do rather than How to do a specific task. Declarative programming is a programming paradigm that expresses the logic of a computation without describing its control flow. -Declarative programming comes with certain advantages such as reduced side effects(occurs when we modify any state or mutating something or making an API request), minimizing mutability(mostly abstracted), enhanced readability, less bugs. +2. React is Declarative for the most part, meaning we are concerned more with What to do, rather than How to do, a specific task. Declarative programming is a paradigm that expresses the logic of a computation without describing its control flow. +This comes with certain advantages such as reduced side effects (such as when we modify any state or mutating something or making an API request), minimizing mutability (mostly abstracted), enhanced readability, and fewer bugs. -3. Unidirectional dataflow. UI in React is actually the function of the state that means as the state updates it updates the UI as well. So our UI progresses as the state changes. +3. Unidirectional dataflow. Data flows only from the state to the User Interface, and not the other way around. UI in React is actually the function of the state, so as the state updates, the UI updates with it. So our UI progresses as the state changes. ## Advantages of React Some reasons to use React are: -1. Fast. Apps made in React can handle complex updates and still feel quick and responsive. -2. Modular. Instead of writing large, dense files of code, you can write many smaller, reusable files. React's modularity can be a beautiful solution to JavaScript's [maintainability problems](https://en.wikipedia.org/wiki/Spaghetti_code). -3. Scalable. Large programs that display a lot of changing data are where React performs best. -4. Flexible. You can use React for interesting projects that have nothing to do with making a web app. People are still figuring out React's potential. [There's room to explore](https://medium.mybridge.co/22-amazing-open-source-react-projects-cb8230ec719f). +1. It's Fast. Apps made in React can handle complex updates and still feel quick and responsive. +2. It's Modular. Instead of writing large, dense files of code, you can write many smaller, reusable files. React's modularity can be a beautiful solution to JavaScript's [maintainability problems](https://en.wikipedia.org/wiki/Spaghetti_code). +3. It's Scalable. Large programs that display a lot of changing data are where React performs best. +4. It's Flexible. You can use React for interesting projects that have nothing to do with making a web app. People are still figuring out React's potential. [There's room to explore](https://medium.mybridge.co/22-amazing-open-source-react-projects-cb8230ec719f). ### Virtual DOM -React's magic comes from it's interpretation of the DOM and it's strategy for creating UIs. +React's magic comes from its interpretation of the DOM and its strategy for creating UIs. -React uses the virtual DOM to render an HTML tree virtually first, and then, every time a state changes and we get a new HTML tree that needs to be taken to the browser’s DOM, instead of writing the whole new tree React will only write the difference between the new tree and the previous tree (since React has both trees in memory). This process is known as Tree Reconciliation. +React uses the virtual DOM to render an HTML tree virtually first. Then, every time a state changes and we get a new HTML tree that needs to be taken to the browser’s DOM, instead of writing the whole new tree React will only write the difference between the new tree and the previous tree (since React has both trees in memory). This process is known as Tree Reconciliation. ### Reconciliation @@ -88,7 +88,7 @@ In this article we are going to look at how we can get started with React using ### 1 — Set Up Boiler Plate Code with Emmet -Let’s get started with step 1. We’ll begin with a file in our browser called “index.html”. We’ll begin with the boiler plate code HTML code. For a quick start I recommend using Emmet with whatever text editor you have and on the first line typing in `html:5` then pressing the shift key to get the code below. Or you can go ahead and copy and paste the code from below. +Let’s get started with step 1. We’ll begin with a file in our browser called “index.html”. We’ll begin with the boiler plate HTML code. For a quick start I recommend using Emmet with whatever text editor you have, and on the first line typing in `html:5` then pressing the shift key to get the code below. Or you can go ahead and copy and paste the code from below. ```javascript html:5 @@ -111,14 +111,14 @@ This will result in the following code: ``` -We can fill in the title of “Time to React!”. +We can fill in the title as “Time to React!”. -This content will not appear in your webpage. Anything in the head section of the HTML file will be meta data that our browser will user to interpret our code in the body section. This title is going to be what appears on the tab for our page, not actually on the page. +This content will not appear in your webpage. Anything in the head section of the HTML file will be metadata that our browser will use to interpret our code in the body section. This title is going to be what appears on the tab for our page, not actually on the page. ### 2 - Get Script Tags to Harness the Power of React and Babel Libraries -Ok, item one is checked off of our list. Let’s look at item two. We are going to set up our developer environment by using script tags to bring in React and Babel. This is not a real life developer environment. That would be quite an elaborate setup. It would also leave us with a lot of boiler plate code and libraries that would take us off subject of learning React basics. The goal of this series is to go over the basic syntax of React and get right into coding. -We are going to use `