Skip to content

Commit bb6718c

Browse files
committed
Add release notes for unstable_flushSync
1 parent d7f03a1 commit bb6718c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

RELEASES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,16 @@ To add a new release, copy from this template:
153153

154154
#### `unstable_flushSync` API
155155

156+
This release brings a new `unstable_flushSync` option to the imperative APIs (`useSubmit`, `useNavigate`, `fetcher.submit`, `fetcher.load`) to let users opt-into synchronous DOM updates for pending/optimistic UI.
157+
158+
```js
159+
function handleClick() {
160+
submit(data, { flushSync: true });
161+
// Everything is flushed to the DOM so you can focus/scroll to your pending/optimistic UI
162+
setFocusAndOrScrollToNewlyAddedThing();
163+
}
164+
```
165+
156166
### Minor Changes
157167

158168
- Add `unstable_flushSync` option to `useNavigate`/`useSubmit`/`fetcher.load`/`fetcher.submit` to opt-out of `React.startTransition` and into `ReactDOM.flushSync` for state updates ([#11005](https://github.com/remix-run/react-router/pull/11005))

0 commit comments

Comments
 (0)