Skip to content

Commit 3f51438

Browse files
committed
Bump to 19.2
1 parent 911ba93 commit 3f51438

File tree

2 files changed

+2
-155
lines changed

2 files changed

+2
-155
lines changed

src/components/MDX/Sandpack/template.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ root.render(
3535
eject: 'react-scripts eject',
3636
},
3737
dependencies: {
38-
react: '^19.1.0',
39-
'react-dom': '^19.1.0',
38+
react: '^19.2.0',
39+
'react-dom': '^19.2.0',
4040
'react-scripts': '^5.0.0',
4141
},
4242
},

src/content/reference/react/Activity.md

Lines changed: 0 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -164,23 +164,6 @@ h1 {
164164
}
165165
```
166166

167-
```json package.json hidden
168-
{
169-
"dependencies": {
170-
"react": "experimental",
171-
"react-dom": "experimental",
172-
"react-scripts": "latest",
173-
"toastify-js": "1.12.0"
174-
},
175-
"scripts": {
176-
"start": "react-scripts start",
177-
"build": "react-scripts build",
178-
"test": "react-scripts test --env=jsdom",
179-
"eject": "react-scripts eject"
180-
}
181-
}
182-
```
183-
184167
</Sandpack>
185168

186169
The Overview section always starts out collapsed. Because we unmount the sidebar when `isShowingSidebar` flips to `false`, all its internal state is lost.
@@ -288,23 +271,6 @@ h1 {
288271
}
289272
```
290273

291-
```json package.json hidden
292-
{
293-
"dependencies": {
294-
"react": "experimental",
295-
"react-dom": "experimental",
296-
"react-scripts": "latest",
297-
"toastify-js": "1.12.0"
298-
},
299-
"scripts": {
300-
"start": "react-scripts start",
301-
"build": "react-scripts build",
302-
"test": "react-scripts test --env=jsdom",
303-
"eject": "react-scripts eject"
304-
}
305-
}
306-
```
307-
308274
</Sandpack>
309275

310276
Our sidebar's internal state is now restored, without any changes to its implementation.
@@ -399,23 +365,6 @@ b { display: inline-block; margin-right: 10px; }
399365
.pending { color: #777; }
400366
```
401367

402-
```json package.json hidden
403-
{
404-
"dependencies": {
405-
"react": "experimental",
406-
"react-dom": "experimental",
407-
"react-scripts": "latest",
408-
"toastify-js": "1.12.0"
409-
},
410-
"scripts": {
411-
"start": "react-scripts start",
412-
"build": "react-scripts build",
413-
"test": "react-scripts test --env=jsdom",
414-
"eject": "react-scripts eject"
415-
}
416-
}
417-
```
418-
419368
</Sandpack>
420369

421370
This is because we're fully unmounting `Contact` in `App`. When the Contact tab unmounts, the `<textarea>` element's internal DOM state is lost.
@@ -508,23 +457,6 @@ b { display: inline-block; margin-right: 10px; }
508457
.pending { color: #777; }
509458
```
510459

511-
```json package.json hidden
512-
{
513-
"dependencies": {
514-
"react": "experimental",
515-
"react-dom": "experimental",
516-
"react-scripts": "latest",
517-
"toastify-js": "1.12.0"
518-
},
519-
"scripts": {
520-
"start": "react-scripts start",
521-
"build": "react-scripts build",
522-
"test": "react-scripts test --env=jsdom",
523-
"eject": "react-scripts eject"
524-
}
525-
}
526-
```
527-
528460
</Sandpack>
529461

530462
Again, the Activity boundary let us preserve the Contact tab's internal state without changing its implementation.
@@ -675,23 +607,6 @@ b { display: inline-block; margin-right: 10px; }
675607
video { width: 300px; margin-top: 10px; aspect-ratio: 16/9; }
676608
```
677609

678-
```json package.json hidden
679-
{
680-
"dependencies": {
681-
"react": "experimental",
682-
"react-dom": "experimental",
683-
"react-scripts": "latest",
684-
"toastify-js": "1.12.0"
685-
},
686-
"scripts": {
687-
"start": "react-scripts start",
688-
"build": "react-scripts build",
689-
"test": "react-scripts test --env=jsdom",
690-
"eject": "react-scripts eject"
691-
}
692-
}
693-
```
694-
695610
</Sandpack>
696611

697612
This is because `App` doesn't mount `Posts` until its tab is active.
@@ -828,23 +743,6 @@ b { display: inline-block; margin-right: 10px; }
828743
video { width: 300px; margin-top: 10px; aspect-ratio: 16/9; }
829744
```
830745

831-
```json package.json hidden
832-
{
833-
"dependencies": {
834-
"react": "experimental",
835-
"react-dom": "experimental",
836-
"react-scripts": "latest",
837-
"toastify-js": "1.12.0"
838-
},
839-
"scripts": {
840-
"start": "react-scripts start",
841-
"build": "react-scripts build",
842-
"test": "react-scripts test --env=jsdom",
843-
"eject": "react-scripts eject"
844-
}
845-
}
846-
```
847-
848746
</Sandpack>
849747

850748
`Posts` was able to prepare itself for a faster render, thanks to the hidden Activity boundary.
@@ -1097,23 +995,6 @@ b { display: inline-block; margin-right: 10px; }
1097995
video { width: 300px; margin-top: 10px; aspect-ratio: 16/9; }
1098996
```
1099997

1100-
```json package.json hidden
1101-
{
1102-
"dependencies": {
1103-
"react": "experimental",
1104-
"react-dom": "experimental",
1105-
"react-scripts": "latest",
1106-
"toastify-js": "1.12.0"
1107-
},
1108-
"scripts": {
1109-
"start": "react-scripts start",
1110-
"build": "react-scripts build",
1111-
"test": "react-scripts test --env=jsdom",
1112-
"eject": "react-scripts eject"
1113-
}
1114-
}
1115-
```
1116-
1117998
</Sandpack>
1118999

11191000
The video stops playing as expected.
@@ -1207,23 +1088,6 @@ b { display: inline-block; margin-right: 10px; }
12071088
video { width: 300px; margin-top: 10px; aspect-ratio: 16/9; }
12081089
```
12091090

1210-
```json package.json hidden
1211-
{
1212-
"dependencies": {
1213-
"react": "experimental",
1214-
"react-dom": "experimental",
1215-
"react-scripts": "latest",
1216-
"toastify-js": "1.12.0"
1217-
},
1218-
"scripts": {
1219-
"start": "react-scripts start",
1220-
"build": "react-scripts build",
1221-
"test": "react-scripts test --env=jsdom",
1222-
"eject": "react-scripts eject"
1223-
}
1224-
}
1225-
```
1226-
12271091
</Sandpack>
12281092

12291093
Whoops! The video and audio continue to play even after it's been hidden, because the tab's `<video>` element is still in the DOM.
@@ -1354,23 +1218,6 @@ b { display: inline-block; margin-right: 10px; }
13541218
video { width: 300px; margin-top: 10px; aspect-ratio: 16/9; }
13551219
```
13561220

1357-
```json package.json hidden
1358-
{
1359-
"dependencies": {
1360-
"react": "experimental",
1361-
"react-dom": "experimental",
1362-
"react-scripts": "latest",
1363-
"toastify-js": "1.12.0"
1364-
},
1365-
"scripts": {
1366-
"start": "react-scripts start",
1367-
"build": "react-scripts build",
1368-
"test": "react-scripts test --env=jsdom",
1369-
"eject": "react-scripts eject"
1370-
}
1371-
}
1372-
```
1373-
13741221
</Sandpack>
13751222

13761223
It works great! Our cleanup function ensures that the video stops playing if it's ever hidden by an Activity boundary, and even better, because the `<video>` tag is never destroyed, the timecode is preserved, and the video itself doesn't need to be initialized or downloaded again when the user switches back to keep watching it.

0 commit comments

Comments
 (0)