Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,5 @@ If you await a Promise, React will display duration of that Promise. To see all

Different colors are used to indicate the duration of the component render. The darker the color, the longer the duration.

The Server Components track group will always contain a "Primary" track. If React is able to render Server Components concurrently, it will display addititional "Parallel" tracks.
The Server Components track group will always contain a "Primary" track. If React is able to render Server Components concurrently, it will display additional "Parallel" tracks.
If more than 8 Server Components are rendered concurrently, React will associate them with the last "Parallel" track instead of adding more tracks.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function Component({user}) {
}
```

If the side effect sychronizes React state with some external state (or vice versa), use `useEffect`:
If the side effect synchronizes React state with some external state (or vice versa), use `useEffect`:

```js
// ✅ Good: Synchronization in useEffect
Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/react-dom/client/createRoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ const container = document.getElementById("root");
const root = createRoot(container, {
// Keep in mind to remove these options in development to leverage
// React's default handlers or implement your own overlay for development.
// The handlers are only specfied unconditionally here for demonstration purposes.
// The handlers are only specified unconditionally here for demonstration purposes.
onCaughtError: onCaughtErrorProd,
onRecoverableError: onRecoverableErrorProd,
onUncaughtError: onUncaughtErrorProd,
Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/react-dom/client/hydrateRoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ const container = document.getElementById("root");
hydrateRoot(container, <App />, {
// Keep in mind to remove these options in development to leverage
// React's default handlers or implement your own overlay for development.
// The handlers are only specfied unconditionally here for demonstration purposes.
// The handlers are only specified unconditionally here for demonstration purposes.
onCaughtError: onCaughtErrorProd,
onRecoverableError: onRecoverableErrorProd,
onUncaughtError: onUncaughtErrorProd,
Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/react-dom/flushSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ useEffect(() => {
}, []);
```

This will allow the current render to finish and schedule another syncronous render to flush the updates.
This will allow the current render to finish and schedule another synchronous render to flush the updates.

<Pitfall>

Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/react-dom/server/resume.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ async function main(frame) {
// Layer 2
// Just waiting here for demonstration purposes.
// In a real app, the prelude and postponed state would've been serialized in Layer 1 and Layer would deserialize them.
// The prelude content could be flushed immediated as plain HTML while
// The prelude content could be flushed immediately as plain HTML while
// React is continuing to render from where the prerender left off.
await sleep(2000);

Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/react/StrictMode.md
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ li {

</Sandpack>

Now on inital mount in StrictMode, the ref callbacks are all setup, cleaned up, and setup again:
Now on initial mount in StrictMode, the ref callbacks are all setup, cleaned up, and setup again:

```
...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const uppercasePassword = password.toUpperCase() // `uppercasePassword` is not t

In this example, the constant `password` is tainted. Then `password` is used to create a new value `uppercasePassword` by calling the `toUpperCase` method on `password`. The newly created `uppercasePassword` is not tainted.

Other similar ways of deriving new values from tainted values like concatenating it into a larger string, converting it to base64, or returning a substring create untained values.
Other similar ways of deriving new values from tainted values like concatenating it into a larger string, converting it to base64, or returning a substring create untainted values.

Tainting only protects against simple mistakes like explicitly passing secret values to the client. Mistakes in calling the `taintUniqueValue` like using a global store outside of React, without the corresponding lifetime object, can cause the tainted value to become untainted. Tainting is a layer of protection; a secure app will have multiple layers of protection, well designed APIs, and isolation patterns.

Expand Down
4 changes: 2 additions & 2 deletions src/content/reference/react/useActionState.md
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ There are two ways to handle errors with `useActionState`.

For known errors, such as "quantity not available" validation errors from your backend, you can return it as part of your `reducerAction` state and display it in the UI.

For unknown errors, such as `undefined is not a function`, you can throw an error. React will cancel all queued Actions and shows the nearest [Error Boundary](/reference/react/Component#catching-rendering-errors-with-an-error-boundary) by rethrowing the error from the `useActionState` hook.
For unknown errors, such as `undefined is not a function`, you can throw an error. React will cancel all queued Actions and show the nearest [Error Boundary](/reference/react/Component#catching-rendering-errors-with-an-error-boundary) by rethrowing the error from the `useActionState` hook.

<Sandpack>

Expand All @@ -1216,7 +1216,7 @@ function Checkout() {
const result = await addToCart(prevState.count, quantity);
if (result.error) {
// Return the error from the API as state
return {...prevState, error: `Could not add quanitiy ${quantity}: ${result.error}`};
return {...prevState, error: `Could not add quantity ${quantity}: ${result.error}`};
}

if (!isPending) {
Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/react/useContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ You might have a provider without a `value` in the tree:

If you forget to specify `value`, it's like passing `value={undefined}`.

You may have also mistakingly used a different prop name by mistake:
You may have also used a different prop name by mistake:

```js {1,2}
// 🚩 Doesn't work: prop should be called "value"
Expand Down
2 changes: 1 addition & 1 deletion src/content/versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ For versions older than React 15, see [15.react.dev](https://15.react.dev).
- [The Road to 1.0](https://legacy.reactjs.org/blog/2014/03/28/the-road-to-1.0.html)
- [React v0.11.1](https://legacy.reactjs.org/blog/2014/07/25/react-v0.11.1.html)
- [React v0.11.2](https://legacy.reactjs.org/blog/2014/09/16/react-v0.11.2.html)
- [Introducing the JSX Specificaion](https://legacy.reactjs.org/blog/2014/09/03/introducing-the-jsx-specification.html)
- [Introducing the JSX Specification](https://legacy.reactjs.org/blog/2014/09/03/introducing-the-jsx-specification.html)

**Releases**
- [v0.11.2 (September 2014)](https://github.com/react/react/blob/main/CHANGELOG.md#0112-september-16-2014)
Expand Down
Loading