Skip to content
Permalink
Browse files
Update Example render for React v18 (#24259)
  • Loading branch information
nnnnoel committed Apr 3, 2022
1 parent b8cfda1 commit e912da964dbf5f84bf8c4e78e0ac218362bc074e
Showing 1 changed file with 4 additions and 4 deletions.
@@ -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 <div>Hello {name}</div>;
}
ReactDOM.render(
<HelloMessage name="Taylor" />,
document.getElementById('container')
);
const root = createRoot(document.getElementById('container'));
root.render(<HelloMessage name="Taylor" />);
```

This example will render "Hello Taylor" into a container on the page.

0 comments on commit e912da9

Please sign in to comment.