Skip to content

Commit 29a6996

Browse files
committed
Merge branch 'main' of https://github.com/reactjs/reactjs.org into sync-b12743c3
2 parents 8281809 + b12743c commit 29a6996

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

src/content/blog/2024/04/25/react-19-upgrade-guide.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ root.render(<App />);
405405

406406
<Note>
407407

408-
Codemod `ReactDOM.render` to `ReactDOM.createRoot`:
408+
Codemod `ReactDOM.render` to `ReactDOMClient.createRoot`:
409409

410410
```bash
411411
npx codemod@latest react/19/replace-reactdom-render
@@ -427,6 +427,15 @@ import {hydrateRoot} from 'react-dom/client';
427427
hydrateRoot(document.getElementById('root'), <App />);
428428
```
429429

430+
<Note>
431+
432+
Codemod `ReactDOM.hydrate` to `ReactDOMClient.hydrateRoot`:
433+
434+
```bash
435+
npx codemod@latest react/19/replace-reactdom-render
436+
```
437+
438+
</Note>
430439

431440
#### Removed: `unmountComponentAtNode` {/*removed-unmountcomponentatnode*/}
432441

@@ -443,8 +452,18 @@ root.unmount();
443452

444453
For more see `root.unmount()` for [`createRoot`](https://react.dev/reference/react-dom/client/createRoot#root-unmount) and [`hydrateRoot`](https://react.dev/reference/react-dom/client/hydrateRoot#root-unmount).
445454

455+
<Note>
456+
457+
Codemod `unmountComponentAtNode` to `root.unmount`:
458+
459+
```bash
460+
npx codemod@latest react/19/replace-reactdom-render
461+
```
462+
463+
</Note>
446464

447465
#### Removed: `ReactDOM.findDOMNode` {/*removed-reactdom-finddomnode*/}
466+
448467
`ReactDOM.findDOMNode` was [deprecated in October 2018 (v16.6.0)](https://legacy.reactjs.org/blog/2018/10/23/react-v-16-6.html#deprecations-in-strictmode).
449468

450469
We're removing `findDOMNode` because it was a legacy escape hatch that was slow to execute, fragile to refactoring, only returned the first child, and broke abstraction levels (see more [here](https://legacy.reactjs.org/docs/strict-mode.html#warning-about-deprecated-finddomnode-usage)). You can replace `ReactDOM.findDOMNode` with [DOM refs](/learn/manipulating-the-dom-with-refs):

src/content/warnings/react-test-renderer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: react-test-renderer Deprecation Warnings
66

77
react-test-renderer is deprecated. A warning will fire whenever calling ReactTestRenderer.create() or ReactShallowRender.render(). The react-test-renderer package will remain available on NPM but will not be maintained and may break with new React features or changes to React's internals.
88

9-
The React Team recommends migrating your tests to [@testing-library/react](https://testing-library.com/docs/react-testing-library/intro/) or [@testing-library/react-native](https://callstack.github.io/react-native-testing-library/docs/getting-started) for a modern and well supported testing experience.
9+
The React Team recommends migrating your tests to [@testing-library/react](https://testing-library.com/docs/react-testing-library/intro/) or [@testing-library/react-native](https://callstack.github.io/react-native-testing-library/docs/start/intro) for a modern and well supported testing experience.
1010

1111

1212
## new ShallowRenderer() warning {/*new-shallowrenderer-warning*/}

0 commit comments

Comments
 (0)