diff --git a/src/content/reference/react/act.md b/src/content/reference/react/act.md index 256befa31c6..c01f3cd691d 100644 --- a/src/content/reference/react/act.md +++ b/src/content/reference/react/act.md @@ -90,7 +90,7 @@ To test the render output of a component, wrap the render inside `act()`: ```js {10,12} import {act} from 'react'; -import ReactDOM from 'react-dom/client'; +import ReactDOMClient from 'react-dom/client'; import Counter from './Counter'; it('can render and update a counter', async () => { @@ -99,7 +99,7 @@ it('can render and update a counter', async () => { // ✅ Render the component inside act(). await act(() => { - ReactDOM.createRoot(container).render(); + ReactDOMClient.createRoot(container).render(); }); const button = container.querySelector('button'); @@ -119,7 +119,7 @@ To test events, wrap the event dispatch inside `act()`: ```js {14,16} import {act} from 'react'; -import ReactDOM from 'react-dom/client'; +import ReactDOMClient from 'react-dom/client'; import Counter from './Counter'; it.only('can render and update a counter', async () => { @@ -174,4 +174,4 @@ global.IS_REACT_ACT_ENVIRONMENT=true In testing frameworks like [React Testing Library](https://testing-library.com/docs/react-testing-library/intro), `IS_REACT_ACT_ENVIRONMENT` is already set for you. - \ No newline at end of file +