Skip to content

Commit c6c270d

Browse files
committed
docs: update api types
1 parent 50b7138 commit c6c270d

File tree

1 file changed

+57
-1
lines changed

1 file changed

+57
-1
lines changed

docs/router/framework/react/api/router/RouterEventsType.md

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,39 @@ type RouterEvents = {
1313
toLocation: ParsedLocation
1414
pathChanged: boolean
1515
hrefChanged: boolean
16+
hashChanged: boolean
1617
}
1718
onBeforeLoad: {
1819
type: 'onBeforeLoad'
1920
fromLocation?: ParsedLocation
2021
toLocation: ParsedLocation
2122
pathChanged: boolean
2223
hrefChanged: boolean
24+
hashChanged: boolean
2325
}
2426
onLoad: {
2527
type: 'onLoad'
2628
fromLocation?: ParsedLocation
2729
toLocation: ParsedLocation
2830
pathChanged: boolean
2931
hrefChanged: boolean
32+
hashChanged: boolean
3033
}
3134
onResolved: {
3235
type: 'onResolved'
3336
fromLocation?: ParsedLocation
3437
toLocation: ParsedLocation
3538
pathChanged: boolean
3639
hrefChanged: boolean
40+
hashChanged: boolean
3741
}
3842
onBeforeRouteMount: {
3943
type: 'onBeforeRouteMount'
4044
fromLocation?: ParsedLocation
4145
toLocation: ParsedLocation
4246
pathChanged: boolean
4347
hrefChanged: boolean
48+
hashChanged: boolean
4449
}
4550
onInjectedHtml: {
4651
type: 'onInjectedHtml'
@@ -50,6 +55,45 @@ type RouterEvents = {
5055
type: 'onRendered'
5156
fromLocation?: ParsedLocation
5257
toLocation: ParsedLocation
58+
pathChanged: boolean
59+
hrefChanged: boolean
60+
hashChanged: boolean
61+
}
62+
onViewTransitionStart: {
63+
type: 'onViewTransitionStart'
64+
transition: ViewTransition
65+
fromLocation?: ParsedLocation
66+
toLocation: ParsedLocation
67+
pathChanged: boolean
68+
hrefChanged: boolean
69+
hashChanged: boolean
70+
}
71+
onViewTransitionReady: {
72+
type: 'onViewTransitionReady'
73+
transition: ViewTransition
74+
fromLocation?: ParsedLocation
75+
toLocation: ParsedLocation
76+
pathChanged: boolean
77+
hrefChanged: boolean
78+
hashChanged: boolean
79+
}
80+
onViewTransitionUpdateCallbackDone: {
81+
type: 'onViewTransitionUpdateCallbackDone'
82+
transition: ViewTransition
83+
fromLocation?: ParsedLocation
84+
toLocation: ParsedLocation
85+
pathChanged: boolean
86+
hrefChanged: boolean
87+
hashChanged: boolean
88+
}
89+
onViewTransitionFinish: {
90+
type: 'onViewTransitionFinish'
91+
transition: ViewTransition
92+
fromLocation?: ParsedLocation
93+
toLocation: ParsedLocation
94+
pathChanged: boolean
95+
hrefChanged: boolean
96+
hashChanged: boolean
5397
}
5498
}
5599
```
@@ -60,7 +104,7 @@ Once an event is emitted, the following properties will be present on the event
60104
61105
### `type` property
62106
63-
- Type: `onBeforeNavigate | onBeforeLoad | onLoad | onBeforeRouteMount | onResolved`
107+
- Type: `onBeforeNavigate | onBeforeLoad | onLoad | onBeforeRouteMount | onResolved | onRendered | onViewTransitionStart | onViewTransitionReady | onViewTransitionUpdateCallbackDone | onViewTransitionFinish`
64108
- The type of the event
65109
- This is useful for discriminating between events in a listener function.
66110
@@ -84,6 +128,18 @@ Once an event is emitted, the following properties will be present on the event
84128
- Type: `boolean`
85129
- `true` if the href has changed between the `fromLocation` and `toLocation`.
86130
131+
### `hashChanged` property
132+
133+
- Type: `boolean`
134+
- `true` if the hash has changed between the `fromLocation` and `toLocation`.
135+
136+
### `transition` property
137+
138+
- Type: `ViewTransition`
139+
- Available on: `onViewTransitionStart`, `onViewTransitionReady`, `onViewTransitionUpdateCallbackDone`, `onViewTransitionFinish`
140+
- The [ViewTransition](https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition) object representing the view transition in progress.
141+
- This property allows you to interact with the view transition lifecycle, including access to promises like `ready`, `updateCallbackDone`, and `finished`.
142+
87143
## Example
88144
89145
```tsx

0 commit comments

Comments
 (0)