Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: flushSync types #6730

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions src/content/reference/react-dom/flushSync.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Using `flushSync` is uncommon and can hurt the performance of your app.
`flushSync` lets you force React to flush any updates inside the provided callback synchronously. This ensures that the DOM is updated immediately.

```js
flushSync(callback)
flushSync(callback?)
```

</Intro>
Expand All @@ -24,7 +24,7 @@ flushSync(callback)

## Reference {/*reference*/}

### `flushSync(callback)` {/*flushsync*/}
### `flushSync(callback?)` {/*flushsync*/}

Call `flushSync` to force React to flush any pending work and update the DOM synchronously.

Expand All @@ -43,11 +43,11 @@ Most of the time, `flushSync` can be avoided. Use `flushSync` as last resort.
#### Parameters {/*parameters*/}


* `callback`: A function. React will immediately call this callback and flush any updates it contains synchronously. It may also flush any pending updates, or Effects, or updates inside of Effects. If an update suspends as a result of this `flushSync` call, the fallbacks may be re-shown.
* **optional** `callback`: A function. React will immediately call this callback and flush any updates it contains synchronously. It may also flush any pending updates, or Effects, or updates inside of Effects. If an update suspends as a result of this `flushSync` call, the fallbacks may be re-shown.

#### Returns {/*returns*/}

`flushSync` returns `undefined`.
If callback is not passed `flushSync` returns `undefined`, otherwise returns the return value of the `callback` function.

#### Caveats {/*caveats*/}

Expand Down
Loading