diff --git a/examples/basic/package.json b/examples/basic/package.json index 6d48a18..42e2953 100644 --- a/examples/basic/package.json +++ b/examples/basic/package.json @@ -1,11 +1,11 @@ { "dependencies": { - "@emotion/react": "^11.1.5", - "react": "17.0.2", - "react-dom": "17.0.2" + "@emotion/react": "^11.9.3", + "react": "18.0.0", + "react-dom": "18.0.0" }, "devDependencies": { "browserify": "17.0.0", - "esbuild": "^0.14.42" + "esbuild": "^0.14.49" } } diff --git a/examples/basic/src/Main.purs b/examples/basic/src/Main.purs index 7a772c2..02a9453 100644 --- a/examples/basic/src/Main.purs +++ b/examples/basic/src/Main.purs @@ -6,7 +6,7 @@ import Data.Maybe (Maybe(..)) import Effect (Effect) import Effect.Exception (throw) import React.Basic.Hooks (element) -import React.Basic.DOM (render) +import React.Basic.DOM.Client (createRoot, renderRoot) import Web.DOM.NonElementParentNode (getElementById) import Web.HTML (window) import Web.HTML.HTMLDocument (toNonElementParentNode) @@ -18,7 +18,8 @@ main = do case container of Nothing -> throw "Container element not found." Just c -> do + root <- createRoot c ex <- mkEx let app = element ex {} - render app c + renderRoot root app diff --git a/packages.dhall b/packages.dhall index 96b9df1..11e644f 100644 --- a/packages.dhall +++ b/packages.dhall @@ -1,6 +1,6 @@ let upstream = - https://github.com/purescript/package-sets/releases/download/psc-0.15.2-20220612/packages.dhall - sha256:9876aee1362a5dac10061768c68a7ecc4a59ca9267c3760f7d43ea9d3812ec11 + https://github.com/purescript/package-sets/releases/download/psc-0.15.2-20220706/packages.dhall + sha256:7a24ebdbacb2bfa27b2fc6ce3da96f048093d64e54369965a2a7b5d9892b6031 in upstream with react-basic = @@ -8,5 +8,4 @@ in upstream , repo = "https://github.com/lumihq/purescript-react-basic" , version = "v17.0.0" } - -- React 18 Support with react-basic-dom.version = "4633ad95b47a5806ca559dfb3b16b5339564f0ad"