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+
210211import Sidebar from ' ./Sidebar.js' ;
211212
212213export default function App () {
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 ;
429430import TabButton from ' ./TabButton.js' ;
430431import Home from ' ./Home.js' ;
431432import 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 ;
707708import TabButton from ' ./TabButton.js' ;
708709import Home from ' ./Home.js' ;
709710import 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 ;
11311132import TabButton from ' ./TabButton.js' ;
11321133import Home from ' ./Home.js' ;
11331134import 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 ;
12651266import TabButton from ' ./TabButton.js' ;
12661267import Home from ' ./Home.js' ;
12671268import 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