Skip to content

Commit 8088d6d

Browse files
committed
update code and sandbox to recommended react syntax
1 parent 5ddf961 commit 8088d6d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ return (
7878

7979
```javascript
8080
import React, { useState } from "react";
81-
import ReactDOM from "react-dom";
81+
import { createRoot } from "react-dom/client";
8282
import FileUpload from "react-mui-fileuploader";
8383

84-
function Wrapper() {
84+
function MuiFileUploader() {
8585
const [filesToUpload, setFilesToUpload] = useState([]);
8686

8787
const handleFilesChange = (files) => {
@@ -112,10 +112,11 @@ function Wrapper() {
112112
);
113113
}
114114

115-
ReactDOM.render(<Wrapper />, document.querySelector("#root"));
115+
const root = createRoot(document.getElementById("root"));
116+
root.render(<MuiFileUploader />);
116117
```
117118

118-
[![Edit thirsty-visvesvaraya-r9u6ho](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/thirsty-visvesvaraya-r9u6ho?fontsize=14&hidenavigation=1&theme=dark)
119+
[![Edit react-mui-fileuploader example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/thirsty-visvesvaraya-r9u6ho?fontsize=14&hidenavigation=1&theme=dark)
119120

120121
## Data structure
121122

0 commit comments

Comments
 (0)