Skip to content

Commit 9998e91

Browse files
committed
wip
1 parent 6150228 commit 9998e91

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/content/blog/2025/04/01/react-labs-what-we-have-been-working-on-april-2025.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ const deferred = useDeferredValue(value);
9393
By default, these animations have the [default CSS animations for View Transitions](https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API/Using#customizing_your_animations) applied (most are given a default smooth cross-fade). You can use [view transition psuedo-selectors](https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API/Using#the_view_transition_pseudo-element_tree) to define "how" the animation runs. For example, using `*` we can change the default for all animations:
9494

9595
```
96-
// "how" to animate.
96+
// "how" to animate.
9797
::view-transition-old(*) {
9898
animation: 300ms ease-out fade-out;
9999
}
@@ -1280,7 +1280,7 @@ In our example app above, notice that there are already animations when you clic
12801280

12811281
Our app includes a Suspense-enabled router, with [page transitions already marked as Transitions](/reference/react/useTransition#building-a-suspense-enabled-router), which means navigations are performed with `startTranstion`:
12821282

1283-
```js {2}
1283+
```js
12841284
function navigate(url) {
12851285
startTransition(() => {
12861286
go(url);
@@ -1290,7 +1290,7 @@ function navigate(url) {
12901290

12911291
`startTransition` is a View Transition trigger, so we can add `<ViewTransition>` to animate between pages:
12921292

1293-
```js {2,4}
1293+
```js
12941294
// "what" to animate
12951295
<ViewTransition key={url}>
12961296
{url === '/' ? <Home /> : <TalkDetails />}
@@ -2479,7 +2479,7 @@ For example, we can slow down the `default` cross fade animation:
24792479

24802480
And define `slow-fade` in CSS using [view transition classes](/reference/react/ViewTransition#view-transition-classes):
24812481

2482-
```css {1,5}
2482+
```css
24832483
::view-transition-old(.slow-fade) {
24842484
animation-duration: 500ms;
24852485
}
@@ -3673,7 +3673,7 @@ When two pages include the same element, often you want to animate it from one p
36733673

36743674
To do this you can add a unique `name` to the `<ViewTransition>`:
36753675

3676-
```js {1,3}
3676+
```js
36773677
<ViewTransition name={`video-${video.id}`}>
36783678
<Thumbnail video={video} />
36793679
</ViewTranstion>
@@ -4882,14 +4882,14 @@ Sometimes, you may want elements to animate differently based on how it was trig
48824882
```js {4,11}
48834883
function navigate(url) {
48844884
startTransition(() => {
4885-
// Transition type for the cause "nav forward"
4885+
// Transition type for the cause "nav forward"
48864886
addTransitionType('nav-forward');
48874887
go(url);
48884888
});
48894889
}
48904890
function navigateBack(url) {
48914891
startTransition(() => {
4892-
// Transition type for the cause "nav backward"
4892+
// Transition type for the cause "nav backward"
48934893
addTransitionType('nav-back');
48944894
go(url);
48954895
});
@@ -4911,7 +4911,7 @@ With transition types, you can provide custom animations via props to `<ViewTran
49114911

49124912
Here we pass a `share` prop to define how to animate based on the transiton type. When the share transition activates from `nav-forward`, the view transition class `slide-forward` is applied. When it's from `nav-back`, the `slide-back` animation is activated. Let's define these animations in CSS:
49134913

4914-
```css {1,5,9,13}
4914+
```css
49154915
::view-transition-old(.slide-forward) {
49164916
/* when sliding forward, the "old" page should slide out to left. */
49174917
animation: ...
@@ -10145,8 +10145,8 @@ We're now ready to share the API and how it works, so you can start testing it i
1014510145

1014610146
`<Activity>` is a new component to hide and show parts of the UI:
1014710147

10148-
```[[1, 1, 'visible'], [2,1,'hidden']]
10149-
<Activity mode={isVisible ? 'visible' : 'hidden'>
10148+
```js [[1, 1, "'visible'"], [2, 1, "'hidden'"]]
10149+
<Activity mode={isVisible ? 'visible' : 'hidden'}>
1015010150
<Page />
1015110151
</Activity>
1015210152
```

0 commit comments

Comments
 (0)