Skip to content

Commit 609a3bf

Browse files
gaearoneps1lon
authored andcommitted
Revert "Fix Activity sandboxes (#8035)"
This reverts commit f9fd07c.
1 parent d44deae commit 609a3bf

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
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 } 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;
11545+
import { unstable_ViewTransition as ViewTransition, Activity } from "react"; import Details from "./Details"; import Home from "./Home"; import { useRouter } from "./router";
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, 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;
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'
1288312883

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

src/content/reference/react/Activity.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ and check out the new behavior:
206206
<Sandpack>
207207

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

213212
export default function App() {
@@ -426,7 +425,7 @@ If we switch to using an Activity boundary to show and hide the active tab, we c
426425
<Sandpack>
427426

428427
```js src/App.js active
429-
import { useState } from 'react'; import { unstable_Activity, Activity as ActivityStable} from 'react'; let Activity = ActivityStable ?? unstable_Activity;
428+
import { useState, Activity } from 'react';
430429
import TabButton from './TabButton.js';
431430
import Home from './Home.js';
432431
import Contact from './Contact.js';
@@ -704,7 +703,7 @@ Try clicking the Posts tab now:
704703
<Sandpack>
705704

706705
```js src/App.js
707-
import { useState, Suspense } from 'react'; import { unstable_Activity, Activity as ActivityStable} from 'react'; let Activity = ActivityStable ?? unstable_Activity;
706+
import { useState, Suspense, Activity } from 'react';
708707
import TabButton from './TabButton.js';
709708
import Home from './Home.js';
710709
import Posts from './Posts.js';
@@ -1128,7 +1127,7 @@ Let's update `App` to hide the inactive tab with a hidden Activity boundary inst
11281127
<Sandpack>
11291128

11301129
```js src/App.js active
1131-
import { useState } from 'react'; import { unstable_Activity, Activity as ActivityStable} from 'react'; let Activity = ActivityStable ?? unstable_Activity;
1130+
import { useState, Activity } from 'react';
11321131
import TabButton from './TabButton.js';
11331132
import Home from './Home.js';
11341133
import Video from './Video.js';
@@ -1262,7 +1261,7 @@ Let's see the new behavior. Try playing the video, switching to the Home tab, th
12621261
<Sandpack>
12631262

12641263
```js src/App.js active
1265-
import { useState } from 'react'; import { unstable_Activity, Activity as ActivityStable} from 'react'; let Activity = ActivityStable ?? unstable_Activity;
1264+
import { useState, Activity } from 'react';
12661265
import TabButton from './TabButton.js';
12671266
import Home from './Home.js';
12681267
import Video from './Video.js';

0 commit comments

Comments
 (0)