Skip to content

Commit abb23de

Browse files
authored
doc edited for unstable_useViewTransitionState (#11117)
1 parent a4e91e0 commit abb23de

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

contributors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
- dokeet
6464
- Drishtantr
6565
- edwin177
66+
- eiffelwong1
6667
- ek9
6768
- ekaansharora
6869
- elanis

docs/hooks/use-view-transition-state.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ Consider clicking on an image in a list that you need to expand into the hero im
3030

3131
```jsx
3232
function NavImage({ src, alt, id }) {
33-
let to = `/images/${idx}`;
34-
let vt = unstable_useViewTransitionState(href);
33+
const to = `/images/${id}`;
34+
const isTransitioning = unstable_useViewTransitionState(to);
3535
return (
3636
<Link to={to} unstable_viewTransition>
3737
<img
3838
src={src}
3939
alt={alt}
4040
style={{
41-
viewTransitionName: vt ? "image-expand" : "",
41+
viewTransitionName: isTransitioning ? "image-expand" : "",
4242
}}
4343
/>
4444
</Link>

0 commit comments

Comments
 (0)