Skip to content

Commit c32de02

Browse files
authored
[v19] Update sandboxes to 19 RC (#7196)
1 parent e03b92c commit c32de02

File tree

13 files changed

+60
-999
lines changed

13 files changed

+60
-999
lines changed

src/components/MDX/Sandpack/template.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ root.render(
2828
eject: 'react-scripts eject',
2929
},
3030
dependencies: {
31-
react: '^18.0.0',
32-
'react-dom': '^18.0.0',
31+
react: '19.0.0-rc-3edc000d-20240926',
32+
'react-dom': '19.0.0-rc-3edc000d-20240926',
3333
'react-scripts': '^5.0.0',
3434
},
3535
},

src/content/learn/manipulating-the-dom-with-refs.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -309,16 +309,6 @@ li {
309309
}
310310
```
311311

312-
```json package.json hidden
313-
{
314-
"dependencies": {
315-
"react": "canary",
316-
"react-dom": "canary",
317-
"react-scripts": "^5.0.0"
318-
}
319-
}
320-
```
321-
322312
</Sandpack>
323313

324314
In this example, `itemsRef` doesn't hold a single DOM node. Instead, it holds a [Map](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map) from item ID to a DOM node. ([Refs can hold any values!](/learn/referencing-values-with-refs)) The [`ref` callback](/reference/react-dom/components/common#ref-callback) on every list item takes care to update the Map:

src/content/reference/react-dom/client/createRoot.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -572,17 +572,6 @@ export default function App() {
572572
}
573573
```
574574
575-
```json package.json hidden
576-
{
577-
"dependencies": {
578-
"react": "canary",
579-
"react-dom": "canary",
580-
"react-scripts": "^5.0.0"
581-
},
582-
"main": "/index.js"
583-
}
584-
```
585-
586575
</Sandpack>
587576
588577
@@ -853,8 +842,8 @@ function Throw({error}) {
853842
```json package.json hidden
854843
{
855844
"dependencies": {
856-
"react": "canary",
857-
"react-dom": "canary",
845+
"react": "19.0.0-rc-3edc000d-20240926",
846+
"react-dom": "19.0.0-rc-3edc000d-20240926",
858847
"react-scripts": "^5.0.0",
859848
"react-error-boundary": "4.0.3"
860849
},
@@ -1111,8 +1100,8 @@ function Throw({error}) {
11111100
```json package.json hidden
11121101
{
11131102
"dependencies": {
1114-
"react": "canary",
1115-
"react-dom": "canary",
1103+
"react": "19.0.0-rc-3edc000d-20240926",
1104+
"react-dom": "19.0.0-rc-3edc000d-20240926",
11161105
"react-scripts": "^5.0.0",
11171106
"react-error-boundary": "4.0.3"
11181107
},

src/content/reference/react-dom/client/hydrateRoot.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -606,17 +606,6 @@ export default function App() {
606606
}
607607
```
608608
609-
```json package.json hidden
610-
{
611-
"dependencies": {
612-
"react": "canary",
613-
"react-dom": "canary",
614-
"react-scripts": "^5.0.0"
615-
},
616-
"main": "/index.js"
617-
}
618-
```
619-
620609
</Sandpack>
621610
622611
@@ -890,8 +879,8 @@ function Throw({error}) {
890879
```json package.json hidden
891880
{
892881
"dependencies": {
893-
"react": "canary",
894-
"react-dom": "canary",
882+
"react": "19.0.0-rc-3edc000d-20240926",
883+
"react-dom": "19.0.0-rc-3edc000d-20240926",
895884
"react-scripts": "^5.0.0",
896885
"react-error-boundary": "4.0.3"
897886
},
@@ -1152,8 +1141,8 @@ function Throw({error}) {
11521141
```json package.json hidden
11531142
{
11541143
"dependencies": {
1155-
"react": "canary",
1156-
"react-dom": "canary",
1144+
"react": "19.0.0-rc-3edc000d-20240926",
1145+
"react-dom": "19.0.0-rc-3edc000d-20240926",
11571146
"react-scripts": "^5.0.0",
11581147
"react-error-boundary": "4.0.3"
11591148
},

src/content/reference/react-dom/components/form.md

Lines changed: 2 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,6 @@ export default function Search() {
6969
}
7070
```
7171

72-
```json package.json hidden
73-
{
74-
"dependencies": {
75-
"react": "18.3.0-canary-6db7f4209-20231021",
76-
"react-dom": "18.3.0-canary-6db7f4209-20231021",
77-
"react-scripts": "^5.0.0"
78-
},
79-
"main": "/index.js",
80-
"devDependencies": {}
81-
}
82-
```
83-
8472
</Sandpack>
8573

8674
### Handle form submission with a Server Function {/*handle-form-submission-with-a-server-function*/}
@@ -170,17 +158,6 @@ export async function submitForm(query) {
170158
}
171159
```
172160

173-
```json package.json hidden
174-
{
175-
"dependencies": {
176-
"react": "canary",
177-
"react-dom": "canary",
178-
"react-scripts": "^5.0.0"
179-
},
180-
"main": "/index.js",
181-
"devDependencies": {}
182-
}
183-
```
184161
</Sandpack>
185162

186163
To learn more about the `useFormStatus` Hook see the [reference documentation](/reference/react-dom/hooks/useFormStatus).
@@ -250,19 +227,6 @@ export async function deliverMessage(message) {
250227
}
251228
```
252229

253-
254-
```json package.json hidden
255-
{
256-
"dependencies": {
257-
"react": "18.3.0-canary-6db7f4209-20231021",
258-
"react-dom": "18.3.0-canary-6db7f4209-20231021",
259-
"react-scripts": "^5.0.0"
260-
},
261-
"main": "/index.js",
262-
"devDependencies": {}
263-
}
264-
```
265-
266230
</Sandpack>
267231

268232
[//]: # 'Uncomment the next line, and delete this line after the `useOptimistic` reference documentatino page is published'
@@ -298,8 +262,8 @@ export default function Search() {
298262
```json package.json hidden
299263
{
300264
"dependencies": {
301-
"react": "18.3.0-canary-6db7f4209-20231021",
302-
"react-dom": "18.3.0-canary-6db7f4209-20231021",
265+
"react": "19.0.0-rc-3edc000d-20240926",
266+
"react-dom": "19.0.0-rc-3edc000d-20240926",
303267
"react-scripts": "^5.0.0",
304268
"react-error-boundary": "4.0.3"
305269
},
@@ -364,18 +328,6 @@ export async function signUpNewUser(newEmail) {
364328
}
365329
```
366330

367-
```json package.json hidden
368-
{
369-
"dependencies": {
370-
"react": "canary",
371-
"react-dom": "canary",
372-
"react-scripts": "^5.0.0"
373-
},
374-
"main": "/index.js",
375-
"devDependencies": {}
376-
}
377-
```
378-
379331
</Sandpack>
380332

381333
Learn more about updating state from a form action with the [`useActionState`](/reference/react/useActionState) docs
@@ -412,16 +364,4 @@ export default function Search() {
412364
}
413365
```
414366

415-
```json package.json hidden
416-
{
417-
"dependencies": {
418-
"react": "18.3.0-canary-6db7f4209-20231021",
419-
"react-dom": "18.3.0-canary-6db7f4209-20231021",
420-
"react-scripts": "^5.0.0"
421-
},
422-
"main": "/index.js",
423-
"devDependencies": {}
424-
}
425-
```
426-
427367
</Sandpack>

src/content/reference/react-dom/hooks/useFormStatus.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,6 @@ export async function submitForm(query) {
111111
await new Promise((res) => setTimeout(res, 1000));
112112
}
113113
```
114-
115-
```json package.json hidden
116-
{
117-
"dependencies": {
118-
"react": "canary",
119-
"react-dom": "canary",
120-
"react-scripts": "^5.0.0"
121-
},
122-
"main": "/index.js",
123-
"devDependencies": {}
124-
}
125-
```
126114
</Sandpack>
127115

128116
<Pitfall>
@@ -228,17 +216,6 @@ button {
228216
229217
```
230218
231-
```json package.json hidden
232-
{
233-
"dependencies": {
234-
"react": "canary",
235-
"react-dom": "canary",
236-
"react-scripts": "^5.0.0"
237-
},
238-
"main": "/index.js",
239-
"devDependencies": {}
240-
}
241-
```
242219
</Sandpack>
243220
244221
---

src/content/reference/react/StrictMode.md

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -952,16 +952,6 @@ li {
952952
}
953953
```
954954
955-
```json package.json hidden
956-
{
957-
"dependencies": {
958-
"react": "beta",
959-
"react-dom": "beta",
960-
"react-scripts": "^5.0.0"
961-
}
962-
}
963-
```
964-
965955
</Sandpack>
966956
967957
@@ -1104,16 +1094,6 @@ li {
11041094
}
11051095
```
11061096
1107-
```json package.json hidden
1108-
{
1109-
"dependencies": {
1110-
"react": "beta",
1111-
"react-dom": "beta",
1112-
"react-scripts": "^5.0.0"
1113-
}
1114-
}
1115-
```
1116-
11171097
</Sandpack>
11181098
11191099
**With Strict Mode, you immediately see that there is a problem**. Strict Mode runs an extra setup+cleanup cycle for every callback ref. This callback ref has no cleanup logic, so it adds refs but doesn't remove them. This is a hint that you're missing a cleanup function.
@@ -1241,16 +1221,6 @@ li {
12411221
}
12421222
```
12431223
1244-
```json package.json hidden
1245-
{
1246-
"dependencies": {
1247-
"react": "beta",
1248-
"react-dom": "beta",
1249-
"react-scripts": "^5.0.0"
1250-
}
1251-
}
1252-
```
1253-
12541224
</Sandpack>
12551225
12561226
Now on inital mount in StrictMode, the ref callbacks are all setup, cleaned up, and setup again:

0 commit comments

Comments
 (0)