Skip to content

Commit 55936f8

Browse files
committed
Merge branch 'react-18-zustand' of https://github.com/akutruff/js-framework-benchmark into akutruff-react-18-zustand
2 parents 379d483 + 66ebef2 commit 55936f8

File tree

3 files changed

+74
-54
lines changed

3 files changed

+74
-54
lines changed

frameworks/keyed/react-zustand/package-lock.json

Lines changed: 63 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frameworks/keyed/react-zustand/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-framework-benchmark-react-zustand",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"description": "React Zustand demo",
55
"main": "index.js",
66
"js-framework-benchmark": {
@@ -31,8 +31,8 @@
3131
"webpack-cli": "3.3.4"
3232
},
3333
"dependencies": {
34-
"react": "17.0.1",
35-
"react-dom": "17.0.1",
36-
"zustand": "^3.6.7"
34+
"react": "~18.2.0",
35+
"react-dom": "~18.2.0",
36+
"zustand": "4.1.1"
3737
}
38-
}
38+
}

frameworks/keyed/react-zustand/src/main.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { memo, useCallback } from "react"
2-
import { render } from "react-dom"
2+
import { createRoot } from 'react-dom/client';
33
import create from "zustand"
44
import shallow from "zustand/shallow"
55

@@ -107,9 +107,8 @@ const buildData = (count) => {
107107
for (let i = 0; i < count; i++) {
108108
data[i] = {
109109
id: nextId++,
110-
label: `${A[random(A.length)]} ${C[random(C.length)]} ${
111-
N[random(N.length)]
112-
}`,
110+
label: `${A[random(A.length)]} ${C[random(C.length)]} ${N[random(N.length)]
111+
}`,
113112
}
114113
}
115114

@@ -231,4 +230,6 @@ const Main = () => {
231230
)
232231
}
233232

234-
render(<Main />, document.getElementById("main"))
233+
const container = document.getElementById('main');
234+
const root = createRoot(container);
235+
root.render(<Main />);

0 commit comments

Comments
 (0)