@samitouri / QOS-React-2 / commits / e912da964d

Update Example render for React v18 (#24259)

Noel Kim (김민혁) committed Apr 3, 2022 at 10:41 UTC e912da964dbf5f84bf8c4e78e0ac218362bc074e
1 file changed +4 -4
README.md
+4 -4
@@ -40,14 +40,14 @@ You can improve it by sending pull requests to [this repository](https://github.
40 We have several examples [on the website](https://reactjs.org/). Here is the first one to get you started:
41
42 ```jsx
43 +import { createRoot } from 'react-dom/client';
44 +
45 function HelloMessage({ name }) {
46 return <div>Hello {name}</div>;
47 }
48
47 -ReactDOM.render(
48 - <HelloMessage name="Taylor" />,
49 - document.getElementById('container')
50 -);
49 +const root = createRoot(document.getElementById('container'));
50 +root.render(<HelloMessage name="Taylor" />);
51 ```
52
53 This example will render "Hello Taylor" into a container on the page.