Skip to content

Commit 3ed602e

Browse files
committed
Docs updates
1 parent 8a224b4 commit 3ed602e

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

docs/hooks/use-fetcher.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function SomeComponent() {
107107

108108
## Methods
109109

110-
## `fetcher.load(href, options)`
110+
### `fetcher.load(href, options)`
111111

112112
Loads data from a route loader.
113113

@@ -133,13 +133,15 @@ If you find yourself calling this function inside of click handlers, you can pro
133133

134134
<docs-info>Any `fetcher.load` calls that are active on the page will be re-executed as part of revalidation (either after a navigation submission, another fetcher submission, or a `useRevalidator()` call)</docs-info>
135135

136-
### `options.unstable_flushSync`
136+
#### `options.unstable_flushSync`
137137

138138
The `unstable_flushSync` option tells React Router DOM to wrap the initial state update for this `fetcher.load` in a [`ReactDOM.flushSync`][flush-sync] call instead of the default [`React.startTransition`][start-transition]. This allows you to perform synchronous DOM actions immediately after the update is flushed to the DOM.
139139

140140
<docs-warning>`ReactDOM.flushSync` de-optimizes React and can hurt the performance of your app.</docs-warning>
141141

142-
## `fetcher.submit()`
142+
<docs-warning>Please note that this API is marked unstable and may be subject to breaking changes without a major release</docs-warning>
143+
144+
### `fetcher.submit()`
143145

144146
The imperative version of `<fetcher.Form>`. If a user interaction should initiate the fetch, you should use `<fetcher.Form>`. But if you, the programmer are initiating the fetch (not in response to a user clicking a button, etc.), then use this function.
145147

docs/hooks/use-navigate.md

+4
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ function EditContact() {
9191

9292
The `unstable_flushSync` option tells React Router DOM to wrap the initial state update for this navigation in a [`ReactDOM.flushSync`][flush-sync] call instead of the default [`React.startTransition`][start-transition]. This allows you to perform synchronous DOM actions immediately after the update is flushed to the DOM.
9393

94+
<docs-warning>`unstable_flushSync` only works when using a data router, see [Picking a Router][picking-a-router]</docs-warning>
95+
9496
<docs-warning>`ReactDOM.flushSync` de-optimizes React and can hurt the performance of your app.</docs-warning>
9597

98+
<docs-warning>Please note that this API is marked unstable and may be subject to breaking changes without a major release</docs-warning>
99+
96100
## `options.unstable_viewTransition`
97101

98102
The `unstable_viewTransition` option enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in `document.startViewTransition()`. If you need to apply specific styles for this view transition, you will also need to leverage the [`unstable_useViewTransitionState()`][use-view-transition-state].

docs/hooks/use-submit.md

+2
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ The `unstable_flushSync` option tells React Router DOM to wrap the initial state
166166

167167
<docs-warning>`ReactDOM.flushSync` de-optimizes React and can hurt the performance of your app.</docs-warning>
168168

169+
<docs-warning>Please note that this API is marked unstable and may be subject to breaking changes without a major release</docs-warning>
170+
169171
[pickingarouter]: ../routers/picking-a-router
170172
[form]: ../components/form
171173
[flush-sync]: https://react.dev/reference/react-dom/flushSync

0 commit comments

Comments
 (0)