You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/learn/add-react-to-an-existing-project.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Many React-based frameworks are full-stack and let your React app take advantage
30
30
31
31
## Using React for a part of your existing page {/*using-react-for-a-part-of-your-existing-page*/}
32
32
33
-
Let's say you have an existing page built with another technology (either a server one like Rails, or a client one like Backbone), and you want to render interactive React components somewhere on that page. That's a common way to integrate React--in fact, it's how most React usage looked at Meta for many years!
33
+
Let's say you have an existing page built with another technology (either a server one like Rails, or a client one like Backbone), and you want to render interactive React Components somewhere on that page. That's a common way to integrate React--in fact, it's how most React usage looked at Meta for many years!
Copy file name to clipboardExpand all lines: src/content/learn/adding-interactivity.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,19 @@ title: Adding Interactivity
4
4
5
5
<Intro>
6
6
7
-
Some things on the screen update in response to user input. For example, clicking an image gallery switches the active image. In React, data that changes over time is called *state.* You can add state to any component, and update it as needed. In this chapter, you'll learn how to write components that handle interactions, update their state, and display different output over time.
7
+
Some things on the screen update in response to user input. For example, clicking an image gallery switches the active image. In React, data that changes over time is called *State.* You can add State to any Component, and update it as needed. In this chapter, you'll learn how to write Components that handle interactions, update their State, and display different output over time.
8
8
9
9
</Intro>
10
10
11
11
<YouWillLearnisChapter={true}>
12
12
13
-
*[How to handle user-initiated events](/learn/responding-to-events)
14
-
*[How to make components "remember" information with state](/learn/state-a-components-memory)
13
+
*[How to handle user-initiated Events](/learn/responding-to-events)
14
+
*[How to make Components "remember" information with State](/learn/state-a-components-memory)
15
15
*[How React updates the UI in two phases](/learn/render-and-commit)
16
-
*[Why state doesn't update right after you change it](/learn/state-as-a-snapshot)
17
-
*[How to queue multiple state updates](/learn/queueing-a-series-of-state-updates)
18
-
*[How to update an object in state](/learn/updating-objects-in-state)
19
-
*[How to update an array in state](/learn/updating-arrays-in-state)
16
+
*[Why State doesn't update right after you change it](/learn/state-as-a-snapshot)
17
+
*[How to queue multiple State updates](/learn/queueing-a-series-of-state-updates)
18
+
*[How to update an object in State](/learn/updating-objects-in-state)
19
+
*[How to update an array in State](/learn/updating-arrays-in-state)
20
20
21
21
</YouWillLearn>
22
22
@@ -74,7 +74,7 @@ Read **[Responding to Events](/learn/responding-to-events)** to learn how to add
74
74
75
75
## State: a component's memory {/*state-a-components-memory*/}
76
76
77
-
Components often need to change what's on the screen as a result of an interaction. Typing into the form should update the input field, clicking "next" on an image carousel should change which image is displayed, clicking "buy" puts a product in the shopping cart. Components need to "remember" things: the current input value, the current image, the shopping cart. In React, this kind of component-specific memory is called *state.*
77
+
Components often need to change what's on the screen as a result of an interaction. Typing into the form should update the input field, clicking "next" on an image carousel should change which image is displayed, clicking "buy" puts a product in the shopping cart. Components need to "remember" things: the current input value, the current image, the shopping cart. In React, this kind of Component-specific memory is called *state.*
78
78
79
79
You can add state to a component with a [`useState`](/reference/react/useState) Hook. *Hooks* are special functions that let your components use React features (state is one of those features). The `useState` Hook lets you declare a state variable. It takes the initial state and returns a pair of values: the current state, and a state setter function that lets you update it.
80
80
@@ -235,9 +235,9 @@ Read **[State: A Component's Memory](/learn/state-a-components-memory)** to lear
235
235
236
236
## Render and commit {/*render-and-commit*/}
237
237
238
-
Before your components are displayed on the screen, they must be rendered by React. Understanding the steps in this process will help you think about how your code executes and explain its behavior.
238
+
Before your Components are displayed on the screen, they must be rendered by React. Understanding the steps in this process will help you think about how your code executes and explain its behavior.
239
239
240
-
Imagine that your components are cooks in the kitchen, assembling tasty dishes from ingredients. In this scenario, React is the waiter who puts in requests from customers and brings them their orders. This process of requesting and serving UI has three steps:
240
+
Imagine that your Components are cooks in the kitchen, assembling tasty dishes from ingredients. In this scenario, React is the waiter who puts in requests from customers and brings them their orders. This process of requesting and serving UI has three steps:
241
241
242
242
1.**Triggering** a render (delivering the diner's order to the kitchen)
243
243
2.**Rendering** the component (preparing the order in the kitchen)
0 commit comments