Skip to content

Commit 80d4774

Browse files
authored
Merge pull request #11031 from hamed-zeidabadi/fix/update-react-18-api-in-readme
docs: update README to use React 18 createRoot API
2 parents 6531f17 + 637718e commit 80d4774

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ yarn add react-admin
4747
```jsx
4848
// in app.js
4949
import * as React from "react";
50-
import ReactDOM from 'react-dom';
50+
import { createRoot } from 'react-dom/client';
5151
import { Admin, Resource } from 'react-admin';
5252
import restProvider from 'ra-data-simple-rest';
5353

5454
import { PostList, PostEdit, PostCreate, PostIcon } from './posts';
5555

56-
ReactDOM.createRoot(document.getElementById('root')!).render(
56+
createRoot(document.getElementById('root')!).render(
5757
<Admin dataProvider={restProvider('http://localhost:3000')}>
5858
<Resource name="posts" list={PostList} edit={PostEdit} create={PostCreate} icon={PostIcon} />
5959
</Admin>

0 commit comments

Comments
 (0)