From 3be363f47be76f8bcdfe1662cd8af9232a138c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noel=20Kim=20=28=EA=B9=80=EB=AF=BC=ED=98=81=29?= Date: Sun, 3 Apr 2022 10:41:49 +0900 Subject: [PATCH] Update Example render for React v18 (#24259) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8f2e04c6a9f96..d2f0e08ecc945 100644 --- a/README.md +++ b/README.md @@ -40,14 +40,14 @@ You can improve it by sending pull requests to [this repository](https://github. We have several examples [on the website](https://reactjs.org/). Here is the first one to get you started: ```jsx +import { createRoot } from 'react-dom/client'; + function HelloMessage({ name }) { return
Hello {name}
; } -ReactDOM.render( - , - document.getElementById('container') -); +const root = createRoot(document.getElementById('container')); +root.render(); ``` This example will render "Hello Taylor" into a container on the page.