From 1c1ad8059664736620af1a934b1cca721c7c051d Mon Sep 17 00:00:00 2001 From: zqran Date: Thu, 8 Sep 2022 04:36:05 +0800 Subject: [PATCH] [Beta] Change the position of the comma (#5007) * [Beta] Change the position of the comma * [Beta] Change the position of the comma * [Beta] Change the Learn Doc * [Beta] Change the Learn Doc --- beta/src/content/index.md | 2 +- .../content/learn/add-react-to-a-website.md | 14 +++++++------- .../learn/choosing-the-state-structure.md | 2 +- .../src/content/learn/conditional-rendering.md | 2 +- .../extracting-state-logic-into-a-reducer.md | 2 +- .../importing-and-exporting-components.md | 10 +++++----- .../content/learn/keeping-components-pure.md | 2 +- .../learn/lifecycle-of-reactive-effects.md | 2 +- .../learn/manipulating-the-dom-with-refs.md | 2 +- .../learn/passing-data-deeply-with-context.md | 2 +- .../learn/preserving-and-resetting-state.md | 2 +- .../queueing-a-series-of-state-updates.md | 4 ++-- .../src/content/learn/react-developer-tools.md | 2 +- .../learn/reacting-to-input-with-state.md | 18 +++++++++--------- beta/src/content/learn/rendering-lists.md | 2 +- beta/src/content/learn/responding-to-events.md | 2 +- .../learn/sharing-state-between-components.md | 2 +- .../content/learn/start-a-new-react-project.md | 2 +- .../content/learn/state-a-components-memory.md | 4 ++-- .../learn/synchronizing-with-effects.md | 2 +- beta/src/content/learn/thinking-in-react.md | 2 +- .../content/learn/updating-arrays-in-state.md | 6 +++--- .../content/learn/writing-markup-with-jsx.md | 2 +- beta/src/content/learn/your-first-component.md | 2 +- 24 files changed, 46 insertions(+), 46 deletions(-) diff --git a/beta/src/content/index.md b/beta/src/content/index.md index c779db5f..bc72d3bf 100644 --- a/beta/src/content/index.md +++ b/beta/src/content/index.md @@ -18,7 +18,7 @@ This beta website contains the current draft of the new docs. ## This is a work in progress! {/*this-is-a-work-in-progress*/} -This is a **beta website**. There will be bugs, performance issues, and missing content. +This is a **beta website.** There will be bugs, performance issues, and missing content. ## How much content is ready? {/*how-much-content-is-ready*/} diff --git a/beta/src/content/learn/add-react-to-a-website.md b/beta/src/content/learn/add-react-to-a-website.md index 635f5d83..3a5aca59 100644 --- a/beta/src/content/learn/add-react-to-a-website.md +++ b/beta/src/content/learn/add-react-to-a-website.md @@ -89,7 +89,7 @@ function LikeButton() { ### Step 4: Add your React component to the page {/*step-4-add-your-react-component-to-the-page*/} -Lastly, add three lines to the bottom of **`like-button.js`**. These lines of code find the `
` you added to the HTML in the first step, create a React root, and then display the "Like" button React component inside of it: +Lastly, add three lines to the bottom of **`like-button.js`.** These lines of code find the `
` you added to the HTML in the first step, create a React root, and then display the "Like" button React component inside of it: ```js const rootNode = document.getElementById('like-button-root'); @@ -106,8 +106,8 @@ root.render(React.createElement(LikeButton)); You might want to display React components in multiple places on the same HTML page. This is useful if React-powered parts of your page are separate from each other. You can do this by putting multiple root tags in your HTML and then rendering React components inside each of them with `ReactDOM.createRoot()`. For example: -1. In **`index.html`**, add an additional container element `
`. -2. In **`like-button.js`**, add three more lines at the end: +1. In **`index.html`,** add an additional container element `
`. +2. In **`like-button.js`,** add three more lines at the end: ```js {6,7,8,9} const anotherRootNode = document.getElementById('another-root'); @@ -149,7 +149,7 @@ These two code snippets are equivalent. JSX is popular syntax for describing mar ### Try JSX {/*try-jsx*/} -The quickest way to try JSX is to add the Babel compiler as a ` @@ -185,7 +185,7 @@ It may feel a bit unusual at first to mix JS with markup, but it will grow on yo -The Babel `