diff --git a/examples/todomvc/package-lock.json b/examples/todomvc/package-lock.json index 4666a44c..8947c06e 100644 --- a/examples/todomvc/package-lock.json +++ b/examples/todomvc/package-lock.json @@ -7,8 +7,8 @@ "name": "todomvc-re-frame", "dependencies": { "highlight.js": "11.1.0", - "react": "17.0.2", - "react-dom": "17.0.2" + "react": "18.2.0", + "react-dom": "18.2.0" }, "devDependencies": { "karma": "6.3.4", @@ -1472,6 +1472,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -1696,28 +1697,26 @@ } }, "node_modules/react": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", - "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", "dependencies": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" + "loose-envify": "^1.1.0" }, "engines": { "node": ">=0.10.0" } }, "node_modules/react-dom": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", - "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", "dependencies": { "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "scheduler": "^0.20.2" + "scheduler": "^0.23.0" }, "peerDependencies": { - "react": "17.0.2" + "react": "^18.2.0" } }, "node_modules/readable-stream": { @@ -1844,12 +1843,11 @@ "dev": true }, "node_modules/scheduler": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", - "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", "dependencies": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" + "loose-envify": "^1.1.0" } }, "node_modules/setimmediate": { diff --git a/examples/todomvc/package.json b/examples/todomvc/package.json index 6e6b0f92..f403d1b6 100644 --- a/examples/todomvc/package.json +++ b/examples/todomvc/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "highlight.js": "11.1.0", - "react": "17.0.2", - "react-dom": "17.0.2" + "react": "18.2.0", + "react-dom": "18.2.0" } } diff --git a/examples/todomvc/shadow-cljs.edn b/examples/todomvc/shadow-cljs.edn index 23efd323..784b1f2e 100644 --- a/examples/todomvc/shadow-cljs.edn +++ b/examples/todomvc/shadow-cljs.edn @@ -1,6 +1,6 @@ {:dependencies - [[reagent "1.1.0"] - [re-frame "1.2.0"] + [[reagent "1.2.0"] + [re-frame "1.3.0"] [zprint/zprint "1.2.7"] [day8.re-frame/tracing "0.6.2"] [com.yahoo.platform.yui/yuicompressor "2.4.8" @@ -21,7 +21,7 @@ :modules {:todomvc {:init-fn todomvc.core/main - :preloads [day8.re-frame-10x.preload]}} + :preloads [day8.re-frame-10x.preload.react-18]}} :dev {:compiler-options {:infer-externs false diff --git a/examples/todomvc/src/todomvc/core.cljs b/examples/todomvc/src/todomvc/core.cljs index 28f0713c..ff6c1b5a 100644 --- a/examples/todomvc/src/todomvc/core.cljs +++ b/examples/todomvc/src/todomvc/core.cljs @@ -2,7 +2,7 @@ (:require-macros [secretary.core :refer [defroute]]) (:require [goog.events :as events] [reagent.core :as reagent] - [reagent.dom :as rdom] + [reagent.dom.client :as rdc] [re-frame.core :refer [dispatch dispatch-sync]] [secretary.core :as secretary] ;; These two are only required to make the compiler @@ -51,11 +51,13 @@ ;; } ;; So this is the entry function that kicks off the app once the HTML is loaded. ;; + +(defonce react-root + (rdc/create-root (.getElementById js/document "app"))) + (defn main [] ;; Render the UI into the HTML's
element ;; The view function `todomvc.views/todo-app` is the ;; root view for the entire UI. - (rdom/render [todomvc.views/todo-app] - (.getElementById js/document "app"))) - + (rdc/render react-root [todomvc.views/todo-app]))