react-router 6.17.0-pre.2 → 6.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -57
- package/dist/index.js +1 -1
- package/dist/main.js +1 -1
- package/dist/react-router.development.js +1 -1
- package/dist/react-router.production.min.js +1 -1
- package/dist/umd/react-router.development.js +1 -1
- package/dist/umd/react-router.production.min.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,67 +1,12 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
-
## 6.17.0
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Export a separate `RouterProvider` from `react-router-dom` with `startViewTransition` support ([#10928](https://github.com/remix-run/react-router/pull/10928))
|
|
8
|
-
|
|
9
|
-
## 6.17.0-pre.1
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- [REMOVE] fix lint issues ([#10930](https://github.com/remix-run/react-router/pull/10930))
|
|
14
|
-
|
|
15
|
-
## 6.17.0-pre.0
|
|
16
|
-
|
|
17
|
-
### Minor Changes
|
|
18
|
-
|
|
19
|
-
- Add support for the [View Transitions API](https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition) via `document.startViewTransition` to enable CSS animated transitions on SPA navigations in your application. ([#10916](https://github.com/remix-run/react-router/pull/10916))
|
|
20
|
-
|
|
21
|
-
The simplest approach to enabling a View Transition in your React Router app is via the new `<Link unstable_viewTransition>` prop. This will cause the navigation DOM update to be wrapped in `document.startViewTransition` which will enable transitions for the DOM update. Without any additional CSS styles, you'll get a basic cross-fade animation for your page.
|
|
22
|
-
|
|
23
|
-
If you need to apply more fine-grained styles for your animations, you can leverage the `unstable_useViewTransitionState` hook which will tell you when a transition is in progress and you can use that to apply classes or styles:
|
|
24
|
-
|
|
25
|
-
```jsx
|
|
26
|
-
function ImageLink(to, src, alt) {
|
|
27
|
-
let isTransitioning = unstable_useViewTransitionState(to);
|
|
28
|
-
return (
|
|
29
|
-
<Link to={to} unstable_viewTransition>
|
|
30
|
-
<img
|
|
31
|
-
src={src}
|
|
32
|
-
alt={alt}
|
|
33
|
-
style={{
|
|
34
|
-
viewTransitionName: isTransitioning ? "image-expand" : "",
|
|
35
|
-
}}
|
|
36
|
-
/>
|
|
37
|
-
</Link>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
You can also use the `<NavLink unstable_viewTransition>` shorthand which will manage the hook usage for you and automatically add a `transitioning` class to the `<a>` during the transition:
|
|
43
|
-
|
|
44
|
-
```css
|
|
45
|
-
a.transitioning img {
|
|
46
|
-
view-transition-name: "image-expand";
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
```jsx
|
|
51
|
-
<NavLink to={to} unstable_viewTransition>
|
|
52
|
-
<img src={src} alt={alt} />
|
|
53
|
-
</NavLink>
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
For an example usage of View Transitions with React Router, check out [our fork](https://github.com/brophdawg11/react-router-records) of the [Astro Records](https://github.com/Charca/astro-records) demo.
|
|
57
|
-
|
|
58
|
-
For more information on using the View Transitions API, please refer to the [Smooth and simple transitions with the View Transitions API](https://developer.chrome.com/docs/web-platform/view-transitions/) guide from the Google Chrome team.
|
|
3
|
+
## 6.17.0
|
|
59
4
|
|
|
60
5
|
### Patch Changes
|
|
61
6
|
|
|
62
7
|
- Fix `RouterProvider` `future` prop type to be a `Partial<FutureConfig>` so that not all flags must be specified ([#10900](https://github.com/remix-run/react-router/pull/10900))
|
|
63
8
|
- Updated dependencies:
|
|
64
|
-
- `@remix-run/router@1.10.0
|
|
9
|
+
- `@remix-run/router@1.10.0`
|
|
65
10
|
|
|
66
11
|
## 6.16.0
|
|
67
12
|
|
package/dist/index.js
CHANGED
package/dist/main.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-router",
|
|
3
|
-
"version": "6.17.0
|
|
3
|
+
"version": "6.17.0",
|
|
4
4
|
"description": "Declarative routing for React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"module": "./dist/index.js",
|
|
24
24
|
"types": "./dist/index.d.ts",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@remix-run/router": "1.10.0
|
|
26
|
+
"@remix-run/router": "1.10.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"react": "^18.2.0"
|