You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/components/form.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ interface FormProps
27
27
reloadDocument?:boolean;
28
28
replace?:boolean;
29
29
state?:any;
30
-
unstable_viewTransition?:boolean;
30
+
viewTransition?:boolean;
31
31
}
32
32
```
33
33
@@ -281,9 +281,9 @@ If you are using [`<ScrollRestoration>`][scrollrestoration], this lets you preve
281
281
282
282
See also: [`<Link preventScrollReset>`][link-preventscrollreset]
283
283
284
-
## `unstable_viewTransition`
284
+
## `viewTransition`
285
285
286
-
The `unstable_viewTransition` prop 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].
286
+
The `viewTransition` prop 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 [`useViewTransitionState()`][use-view-transition-state].
287
287
288
288
<docs-warning>Please note that this API is marked unstable and may be subject to breaking changes without a major release</docs-warning>
Copy file name to clipboardExpand all lines: docs/components/link.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ interface LinkProps
23
23
reloadDocument?:boolean;
24
24
replace?:boolean;
25
25
state?:any;
26
-
unstable_viewTransition?:boolean;
26
+
viewTransition?:boolean;
27
27
}
28
28
29
29
typeTo=string|Partial<Path>;
@@ -171,24 +171,24 @@ let { state } = useLocation();
171
171
172
172
The `reloadDocument` property can be used to skip client side routing and let the browser handle the transition normally (as if it were an `<a href>`).
173
173
174
-
## `unstable_viewTransition`
174
+
## `viewTransition`
175
175
176
-
The `unstable_viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in `document.startViewTransition()`:
176
+
The `viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in `document.startViewTransition()`:
177
177
178
178
```jsx
179
-
<Link to={to} unstable_viewTransition>
179
+
<Link to={to} viewTransition>
180
180
Click me
181
181
</Link>
182
182
```
183
183
184
-
If you need to apply specific styles for this view transition, you will also need to leverage the [`unstable_useViewTransitionState()`][use-view-transition-state] hook (or check out the `transitioning` class and `isTransitioning` render prop in [NavLink][navlink]):
184
+
If you need to apply specific styles for this view transition, you will also need to leverage the [`useViewTransitionState()`][use-view-transition-state] hook (or check out the `transitioning` class and `isTransitioning` render prop in [NavLink][navlink]):
185
185
186
186
```jsx
187
187
functionImageLink(to) {
188
188
constisTransitioning=
189
-
unstable_useViewTransitionState(to);
189
+
useViewTransitionState(to);
190
190
return (
191
-
<Link to={to} unstable_viewTransition>
191
+
<Link to={to} viewTransition>
192
192
<p
193
193
style={{
194
194
viewTransitionName: isTransitioning
@@ -212,7 +212,7 @@ function ImageLink(to) {
212
212
}
213
213
```
214
214
215
-
<docs-warning>`unstable_viewTransition` only works when using a data router, see [Picking a Router][picking-a-router]</docs-warning>
215
+
<docs-warning>`viewTransition` only works when using a data router, see [Picking a Router][picking-a-router]</docs-warning>
216
216
217
217
<docs-warning>Please note that this API is marked unstable and may be subject to breaking changes without a major release</docs-warning>
Copy file name to clipboardExpand all lines: docs/components/nav-link.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,9 +123,9 @@ When a `NavLink` is active it will automatically apply `<a aria-current="page">`
123
123
124
124
The `reloadDocument` property can be used to skip client side routing and let the browser handle the transition normally (as if it were an `<a href>`).
125
125
126
-
## `unstable_viewTransition`
126
+
## `viewTransition`
127
127
128
-
The `unstable_viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in `document.startViewTransition()`. By default, during the transition a `transitioning` class will be added to the `<a>` element that you can use to customize the view transition.
128
+
The `viewTransition` prop enables a [View Transition][view-transitions] for this navigation by wrapping the final state update in `document.startViewTransition()`. By default, during the transition a `transitioning` class will be added to the `<a>` element that you can use to customize the view transition.
129
129
130
130
```css
131
131
a.transitioningp {
@@ -138,7 +138,7 @@ a.transitioning img {
138
138
```
139
139
140
140
```jsx
141
-
<NavLink to={to} unstable_viewTransition>
141
+
<NavLink to={to} viewTransition>
142
142
<p>Image Number {idx}</p>
143
143
<img src={src} alt={`Img ${idx}`} />
144
144
</NavLink>
@@ -147,7 +147,7 @@ a.transitioning img {
147
147
You may also use the `className`/`style` props or the render props passed to `children` to further customize based on the `isTransitioning` value.
Copy file name to clipboardExpand all lines: docs/hooks/use-fetcher.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,9 +133,9 @@ If you find yourself calling this function inside of click handlers, you can pro
133
133
134
134
<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>
135
135
136
-
#### `options.unstable_flushSync`
136
+
#### `options.flushSync`
137
137
138
-
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.
138
+
The `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.
139
139
140
140
<docs-warning>Please note that this API is marked unstable and may be subject to breaking changes without a major release</docs-warning>
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.
119
+
The `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.
120
120
121
-
<docs-warning>`unstable_flushSync` only works when using a data router, see [Picking a Router][picking-a-router]</docs-warning>
121
+
<docs-warning>`flushSync` only works when using a data router, see [Picking a Router][picking-a-router]</docs-warning>
122
122
123
123
<docs-warning>Please note that this API is marked unstable and may be subject to breaking changes without a major release</docs-warning>
124
124
125
-
## `options.unstable_viewTransition`
125
+
## `options.viewTransition`
126
126
127
-
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].
127
+
The `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 [`useViewTransitionState()`][use-view-transition-state].
128
128
129
-
<docs-warning>`unstable_viewTransition` only works when using a data router, see [Picking a Router][picking-a-router]</docs-warning>
129
+
<docs-warning>`viewTransition` only works when using a data router, see [Picking a Router][picking-a-router]</docs-warning>
130
130
131
131
<docs-warning>Please note that this API is marked unstable and may be subject to breaking changes without a major release</docs-warning>
Copy file name to clipboardExpand all lines: docs/hooks/use-submit.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,11 +160,11 @@ Because submissions are navigations, the options may also contain the other navi
160
160
-`relative`
161
161
-`replace`
162
162
-`state`
163
-
-`unstable_viewTransition`
163
+
-`viewTransition`
164
164
165
-
### `options.unstable_flushSync`
165
+
### `options.flushSync`
166
166
167
-
The `unstable_flushSync` option tells React Router DOM to wrap the initial state update for this submission 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.
167
+
The `flushSync` option tells React Router DOM to wrap the initial state update for this submission 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.
168
168
169
169
<docs-warning>Please note that this API is marked unstable and may be subject to breaking changes without a major release</docs-warning>
Copy file name to clipboardExpand all lines: docs/hooks/use-view-transition-state.md
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
-
title: unstable_useViewTransitionState
2
+
title: useViewTransitionState
3
3
---
4
4
5
-
# `unstable_useViewTransitionState`
5
+
# `useViewTransitionState`
6
6
7
7
<details>
8
8
<summary>Type declaration</summary>
9
9
10
10
```tsx
11
-
declarefunctionunstable_useViewTransitionState(
11
+
declarefunctionuseViewTransitionState(
12
12
to:To,
13
13
opts: { relative?:"route":"path" } = {}
14
14
):boolean;
@@ -24,17 +24,16 @@ interface Path {
24
24
25
25
</details>
26
26
27
-
This hook returns `true` when there is an active [View Transition][view-transitions] to the specified location. This can be used to apply finer-grained styles to elements to further customize the view transition. This requires that view transitions have been enabled for the given navigation via the [unstable_viewTransition][link-view-transition] prop on the `Link` (or the `Form`, `navigate`, or `submit` call).
27
+
This hook returns `true` when there is an active [View Transition][view-transitions] to the specified location. This can be used to apply finer-grained styles to elements to further customize the view transition. This requires that view transitions have been enabled for the given navigation via the [viewTransition][link-view-transition] prop on the `Link` (or the `Form`, `navigate`, or `submit` call).
28
28
29
29
Consider clicking on an image in a list that you need to expand into the hero image on the destination page:
30
30
31
31
```jsx
32
32
functionNavImage({ src, alt, id }) {
33
33
constto=`/images/${id}`;
34
-
constisTransitioning=
35
-
unstable_useViewTransitionState(to);
34
+
constisTransitioning=useViewTransitionState(to);
36
35
return (
37
-
<Link to={to} unstable_viewTransition>
36
+
<Link to={to} viewTransition>
38
37
<img
39
38
src={src}
40
39
alt={alt}
@@ -49,5 +48,5 @@ function NavImage({ src, alt, id }) {
0 commit comments