Skip to content

Commit 2e4aa5e

Browse files
authored
Merge pull request #17 from lumihq/react-18
Upgrade to React 18
2 parents 499c6e4 + 8c02ed1 commit 2e4aa5e

19 files changed

+183
-269
lines changed

examples/actions/package-lock.json

+27-46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/actions/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"build": "spago build"
55
},
66
"dependencies": {
7-
"react": "^17.0.1",
8-
"react-dom": "^17.0.1"
7+
"react": "^18.0.0",
8+
"react-dom": "^18.0.0"
99
},
1010
"devDependencies": {
1111
"parcel": "^2.6.0",

examples/actions/src/Main.purs

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Actions (actions)
66
import Data.Maybe (Maybe(..))
77
import Effect (Effect)
88
import Effect.Exception (throw)
9-
import React.Basic.DOM (render)
9+
import React.Basic.DOM.Client (createRoot, renderRoot)
1010
import Web.DOM.NonElementParentNode (getElementById)
1111
import Web.HTML (window)
1212
import Web.HTML.HTMLDocument (toNonElementParentNode)
@@ -17,6 +17,7 @@ main = do
1717
container <- getElementById "container" =<< (map toNonElementParentNode $ document =<< window)
1818
case container of
1919
Nothing -> throw "Container element not found."
20-
Just c ->
20+
Just c -> do
21+
root <- createRoot c
2122
let app = actions { label: "Increment" }
22-
in render app c
23+
renderRoot root app

examples/async/package-lock.json

+27-46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/async/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"build": "spago build"
55
},
66
"dependencies": {
7-
"react": "^17.0.1",
8-
"react-dom": "^17.0.1"
7+
"react": "^18.0.0",
8+
"react-dom": "^18.0.0"
99
},
1010
"devDependencies": {
1111
"parcel": "^2.6.0",

examples/async/src/Main.purs

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import AsyncCounter (asyncCounter)
66
import Data.Maybe (Maybe(..))
77
import Effect (Effect)
88
import Effect.Exception (throw)
9-
import React.Basic.DOM (render)
9+
import React.Basic.DOM.Client (createRoot, renderRoot)
1010
import Web.DOM.NonElementParentNode (getElementById)
1111
import Web.HTML (window)
1212
import Web.HTML.HTMLDocument (toNonElementParentNode)
@@ -17,6 +17,7 @@ main = do
1717
container <- getElementById "container" =<< (map toNonElementParentNode $ document =<< window)
1818
case container of
1919
Nothing -> throw "Container element not found."
20-
Just c ->
20+
Just c -> do
21+
root <- createRoot c
2122
let app = asyncCounter { label: "Async Increment" }
22-
in render app c
23+
renderRoot root app

0 commit comments

Comments
 (0)