Skip to content

Commit 370df03

Browse files
committed
hacky fix
1 parent f7ee3bb commit 370df03

File tree

2 files changed

+26
-25
lines changed

2 files changed

+26
-25
lines changed

src/content/blog/2025/04/23/react-labs-view-transitions-activity-and-more.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11542,7 +11542,7 @@ Try searching for a video, selecting it, and clicking "back":
1154211542
<Sandpack>
1154311543

1154411544
```js src/App.js
11545-
import { unstable_ViewTransition as ViewTransition, Activity } from "react"; import Details from "./Details"; import Home from "./Home"; import { useRouter } from "./router";
11545+
import { unstable_ViewTransition as ViewTransition } from "react"; import Details from "./Details"; import Home from "./Home"; import { useRouter } from "./router"; import { unstable_Activity, Activity as ActivityStable} from 'react'; let Activity = ActivityStable ?? unstable_Activity;
1154611546

1154711547
export default function App() {
1154811548
const { url } = useRouter();
@@ -12879,7 +12879,7 @@ With this update, if the content on the next page has time to pre-render, it wil
1287912879
<Sandpack>
1288012880
1288112881
```js src/App.js
12882-
import { unstable_ViewTransition as ViewTransition, Activity, use } from "react"; import Details from "./Details"; import Home from "./Home"; import { useRouter } from "./router"; import {fetchVideos} from './data'
12882+
import { unstable_ViewTransition as ViewTransition, use } from "react"; import Details from "./Details"; import Home from "./Home"; import { useRouter } from "./router"; import {fetchVideos} from './data'; import { unstable_Activity, Activity as ActivityStable} from 'react'; let Activity = ActivityStable ?? unstable_Activity;
1288312883

1288412884
export default function App() {
1288512885
const { url } = useRouter();

src/content/reference/react/Activity.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ h1 {
167167
```json package.json hidden
168168
{
169169
"dependencies": {
170-
"react": "19.2.0",
171-
"react-dom": "19.2.0",
170+
"react": "experimental",
171+
"react-dom": "experimental",
172172
"react-scripts": "latest",
173173
"toastify-js": "1.12.0"
174174
},
@@ -206,7 +206,8 @@ and check out the new behavior:
206206
<Sandpack>
207207

208208
```js src/App.js active
209-
import { Activity, useState } from 'react';
209+
import { useState } from 'react'; import { unstable_Activity, Activity as ActivityStable} from 'react'; let Activity = ActivityStable ?? unstable_Activity;
210+
210211
import Sidebar from './Sidebar.js';
211212

212213
export default function App() {
@@ -291,8 +292,8 @@ h1 {
291292
```json package.json hidden
292293
{
293294
"dependencies": {
294-
"react": "19.2.0",
295-
"react-dom": "19.2.0",
295+
"react": "experimental",
296+
"react-dom": "experimental",
296297
"react-scripts": "latest",
297298
"toastify-js": "1.12.0"
298299
},
@@ -402,8 +403,8 @@ b { display: inline-block; margin-right: 10px; }
402403
```json package.json hidden
403404
{
404405
"dependencies": {
405-
"react": "19.2.0",
406-
"react-dom": "19.2.0",
406+
"react": "experimental",
407+
"react-dom": "experimental",
407408
"react-scripts": "latest",
408409
"toastify-js": "1.12.0"
409410
},
@@ -425,7 +426,7 @@ If we switch to using an Activity boundary to show and hide the active tab, we c
425426
<Sandpack>
426427
427428
```js src/App.js active
428-
import { useState, Activity } from 'react';
429+
import { useState } from 'react'; import { unstable_Activity, Activity as ActivityStable} from 'react'; let Activity = ActivityStable ?? unstable_Activity;
429430
import TabButton from './TabButton.js';
430431
import Home from './Home.js';
431432
import Contact from './Contact.js';
@@ -511,8 +512,8 @@ b { display: inline-block; margin-right: 10px; }
511512
```json package.json hidden
512513
{
513514
"dependencies": {
514-
"react": "19.2.0",
515-
"react-dom": "19.2.0",
515+
"react": "experimental",
516+
"react-dom": "experimental",
516517
"react-scripts": "latest",
517518
"toastify-js": "1.12.0"
518519
},
@@ -678,8 +679,8 @@ video { width: 300px; margin-top: 10px; aspect-ratio: 16/9; }
678679
```json package.json hidden
679680
{
680681
"dependencies": {
681-
"react": "19.2.0",
682-
"react-dom": "19.2.0",
682+
"react": "experimental",
683+
"react-dom": "experimental",
683684
"react-scripts": "latest",
684685
"toastify-js": "1.12.0"
685686
},
@@ -703,7 +704,7 @@ Try clicking the Posts tab now:
703704
<Sandpack>
704705
705706
```js src/App.js
706-
import { useState, Suspense, Activity } from 'react';
707+
import { useState, Suspense } from 'react'; import { unstable_Activity, Activity as ActivityStable} from 'react'; let Activity = ActivityStable ?? unstable_Activity;
707708
import TabButton from './TabButton.js';
708709
import Home from './Home.js';
709710
import Posts from './Posts.js';
@@ -831,8 +832,8 @@ video { width: 300px; margin-top: 10px; aspect-ratio: 16/9; }
831832
```json package.json hidden
832833
{
833834
"dependencies": {
834-
"react": "19.2.0",
835-
"react-dom": "19.2.0",
835+
"react": "experimental",
836+
"react-dom": "experimental",
836837
"react-scripts": "latest",
837838
"toastify-js": "1.12.0"
838839
},
@@ -1100,8 +1101,8 @@ video { width: 300px; margin-top: 10px; aspect-ratio: 16/9; }
11001101
```json package.json hidden
11011102
{
11021103
"dependencies": {
1103-
"react": "19.2.0",
1104-
"react-dom": "19.2.0",
1104+
"react": "experimental",
1105+
"react-dom": "experimental",
11051106
"react-scripts": "latest",
11061107
"toastify-js": "1.12.0"
11071108
},
@@ -1127,7 +1128,7 @@ Let's update `App` to hide the inactive tab with a hidden Activity boundary inst
11271128
<Sandpack>
11281129
11291130
```js src/App.js active
1130-
import { useState, Activity } from 'react';
1131+
import { useState } from 'react'; import { unstable_Activity, Activity as ActivityStable} from 'react'; let Activity = ActivityStable ?? unstable_Activity;
11311132
import TabButton from './TabButton.js';
11321133
import Home from './Home.js';
11331134
import Video from './Video.js';
@@ -1210,8 +1211,8 @@ video { width: 300px; margin-top: 10px; aspect-ratio: 16/9; }
12101211
```json package.json hidden
12111212
{
12121213
"dependencies": {
1213-
"react": "19.2.0",
1214-
"react-dom": "19.2.0",
1214+
"react": "experimental",
1215+
"react-dom": "experimental",
12151216
"react-scripts": "latest",
12161217
"toastify-js": "1.12.0"
12171218
},
@@ -1261,7 +1262,7 @@ Let's see the new behavior. Try playing the video, switching to the Home tab, th
12611262
<Sandpack>
12621263
12631264
```js src/App.js active
1264-
import { useState, Activity } from 'react';
1265+
import { useState } from 'react'; import { unstable_Activity, Activity as ActivityStable} from 'react'; let Activity = ActivityStable ?? unstable_Activity;
12651266
import TabButton from './TabButton.js';
12661267
import Home from './Home.js';
12671268
import Video from './Video.js';
@@ -1357,8 +1358,8 @@ video { width: 300px; margin-top: 10px; aspect-ratio: 16/9; }
13571358
```json package.json hidden
13581359
{
13591360
"dependencies": {
1360-
"react": "19.2.0",
1361-
"react-dom": "19.2.0",
1361+
"react": "experimental",
1362+
"react-dom": "experimental",
13621363
"react-scripts": "latest",
13631364
"toastify-js": "1.12.0"
13641365
},

0 commit comments

Comments
 (0)