Skip to content

Commit

Permalink
upgrade to react 18 in todomvc example
Browse files Browse the repository at this point in the history
  • Loading branch information
kimo-k committed Oct 23, 2023
1 parent 107646a commit 71eea6c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
34 changes: 16 additions & 18 deletions examples/todomvc/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/todomvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
6 changes: 3 additions & 3 deletions examples/todomvc/shadow-cljs.edn
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
Expand Down
10 changes: 6 additions & 4 deletions examples/todomvc/src/todomvc/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 <div id="app" /> 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]))

0 comments on commit 71eea6c

Please sign in to comment.