Skip to content

Commit

Permalink
Merge pull request #512 from reactjs/sync-6570e6cd
Browse files Browse the repository at this point in the history
Sync with react.dev @ 6570e6c
  • Loading branch information
alioguzhan authored Nov 27, 2023
2 parents f131cbd + 7936ed0 commit 4ebb54e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/content/reference/react-dom/hooks/useFormStatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function Submit() {
return <button disabled={status.pending}>Submit</button>
}

export default App() {
export default function App() {
return (
<form action={action}>
<Submit />
Expand Down
12 changes: 7 additions & 5 deletions src/content/reference/react/use-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ async function requestUsername(formData) {
// ...
}

export default App() {
<form action={requestUsername}>
<input type="text" name="username" />
<button type="submit">Request</button>
</form>
export default function App() {
return (
<form action={requestUsername}>
<input type="text" name="username" />
<button type="submit">Request</button>
</form>
);
}
```

Expand Down
2 changes: 1 addition & 1 deletion src/content/reference/react/useSyncExternalStore.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Render mantığınızda kullanabileceğiniz deponun o anki anlık görüntüsüd
* Yeniden render esnasında farklı bir `subscribe` fonksiyonu geçildiğinde React, yeni geçilen `subscribe` fonksiyonu ile depoya yeniden abone olur. `subscribe`'ı bileşenin dışında tanımlayarak bunu önleyebilirsiniz.
* If the store is mutated during a [non-blocking transition update](/reference/react/useTransition), React will fall back to performing that update as blocking. Specifically, React will call `getSnapshot` a second time just before applying changes to the DOM. If it returns a different value than when it was called originally, React will restart the transition update from scratch, this time applying it as a blocking update, to ensure that every component on screen is reflecting the same version of the store.
* If the store is mutated during a [non-blocking transition update](/reference/react/useTransition), React will fall back to performing that update as blocking. Specifically, for every transition update, React will call `getSnapshot` a second time just before applying changes to the DOM. If it returns a different value than when it was called originally, React will restart the update from scratch, this time applying it as a blocking update, to ensure that every component on screen is reflecting the same version of the store.
* It's not recommended to _suspend_ a render based on a store value returned by `useSyncExternalStore`. The reason is that mutations to the external store cannot be [marked as non-blocking transition updates](/reference/react/useTransition), so they will trigger the nearest [`Suspense` fallback](/reference/react/Suspense), replacing already-rendered content on screen with a loading spinner, which typically makes a poor UX.
Expand Down

0 comments on commit 4ebb54e

Please sign in to comment.