@@ -206,7 +206,8 @@ and check out the new behavior:
206
206
<Sandpack >
207
207
208
208
``` 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
+
210
211
import Sidebar from ' ./Sidebar.js' ;
211
212
212
213
export default function App () {
@@ -425,7 +426,7 @@ If we switch to using an Activity boundary to show and hide the active tab, we c
425
426
<Sandpack>
426
427
427
428
` ` ` 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 ;
429
430
import TabButton from ' ./TabButton.js' ;
430
431
import Home from ' ./Home.js' ;
431
432
import Contact from ' ./Contact.js' ;
@@ -703,7 +704,7 @@ Try clicking the Posts tab now:
703
704
<Sandpack>
704
705
705
706
` ` ` 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 ;
707
708
import TabButton from ' ./TabButton.js' ;
708
709
import Home from ' ./Home.js' ;
709
710
import Posts from ' ./Posts.js' ;
@@ -1127,7 +1128,7 @@ Let's update `App` to hide the inactive tab with a hidden Activity boundary inst
1127
1128
<Sandpack>
1128
1129
1129
1130
` ` ` 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 ;
1131
1132
import TabButton from ' ./TabButton.js' ;
1132
1133
import Home from ' ./Home.js' ;
1133
1134
import Video from ' ./Video.js' ;
@@ -1261,7 +1262,7 @@ Let's see the new behavior. Try playing the video, switching to the Home tab, th
1261
1262
<Sandpack>
1262
1263
1263
1264
` ` ` 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 ;
1265
1266
import TabButton from ' ./TabButton.js' ;
1266
1267
import Home from ' ./Home.js' ;
1267
1268
import Video from ' ./Video.js' ;
0 commit comments