Skip to content

Commit 0593d01

Browse files
authored
Fix typo in render-and-commit.md (#7405)
1 parent ff12973 commit 0593d01

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/content/learn/render-and-commit.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Try commenting out the `root.render()` call and see the component disappear!
7070
Once the component has been initially rendered, you can trigger further renders by updating its state with the [`set` function.](/reference/react/useState#setstate) Updating your component's state automatically queues a render. (You can imagine these as a restaurant guest ordering tea, dessert, and all sorts of things after putting in their first order, depending on the state of their thirst or hunger.)
7171

7272
<IllustrationBlock sequential>
73-
<Illustration caption="State update..." alt="React as a server in a restaurant, serving a Card UI to the user, represented as a patron with a cursor for their head. They patron expresses they want a pink card, not a black one!" src="/images/docs/illustrations/i_rerender1.png" />
73+
<Illustration caption="State update..." alt="React as a server in a restaurant, serving a Card UI to the user, represented as a patron with a cursor for their head. The patron expresses they want a pink card, not a black one!" src="/images/docs/illustrations/i_rerender1.png" />
7474
<Illustration caption="...triggers..." alt="React returns to the Component Kitchen and tells the Card Chef they need a pink Card." src="/images/docs/illustrations/i_rerender2.png" />
7575
<Illustration caption="...render!" alt="The Card Chef gives React the pink Card." src="/images/docs/illustrations/i_rerender3.png" />
7676
</IllustrationBlock>
@@ -84,7 +84,7 @@ After you trigger a render, React calls your components to figure out what to di
8484

8585
This process is recursive: if the updated component returns some other component, React will render _that_ component next, and if that component also returns something, it will render _that_ component next, and so on. The process will continue until there are no more nested components and React knows exactly what should be displayed on screen.
8686

87-
In the following example, React will call `Gallery()` and `Image()` several times:
87+
In the following example, React will call `Gallery()` and `Image()` several times:
8888

8989
<Sandpack>
9090

@@ -148,9 +148,9 @@ The default behavior of rendering all components nested within the updated compo
148148

149149
## Step 3: React commits changes to the DOM {/*step-3-react-commits-changes-to-the-dom*/}
150150

151-
After rendering (calling) your components, React will modify the DOM.
151+
After rendering (calling) your components, React will modify the DOM.
152152

153-
* **For the initial render,** React will use the [`appendChild()`](https://developer.mozilla.org/docs/Web/API/Node/appendChild) DOM API to put all the DOM nodes it has created on screen.
153+
* **For the initial render,** React will use the [`appendChild()`](https://developer.mozilla.org/docs/Web/API/Node/appendChild) DOM API to put all the DOM nodes it has created on screen.
154154
* **For re-renders,** React will apply the minimal necessary operations (calculated while rendering!) to make the DOM match the latest rendering output.
155155

156156
**React only changes the DOM nodes if there's a difference between renders.** For example, here is a component that re-renders with different props passed from its parent every second. Notice how you can add some text into the `<input>`, updating its `value`, but the text doesn't disappear when the component re-renders:

0 commit comments

Comments
 (0)