Skip to content

Commit

Permalink
Merge pull request #17 from lumihq/react-18
Browse files Browse the repository at this point in the history
Upgrade to React 18
  • Loading branch information
mjrussell authored Jul 8, 2022
2 parents 499c6e4 + 8c02ed1 commit 2e4aa5e
Show file tree
Hide file tree
Showing 19 changed files with 183 additions and 269 deletions.
73 changes: 27 additions & 46 deletions examples/actions/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/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"build": "spago build"
},
"dependencies": {
"react": "^17.0.1",
"react-dom": "^17.0.1"
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"parcel": "^2.6.0",
Expand Down
7 changes: 4 additions & 3 deletions examples/actions/src/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Actions (actions)
import Data.Maybe (Maybe(..))
import Effect (Effect)
import Effect.Exception (throw)
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)
Expand All @@ -17,6 +17,7 @@ main = do
container <- getElementById "container" =<< (map toNonElementParentNode $ document =<< window)
case container of
Nothing -> throw "Container element not found."
Just c ->
Just c -> do
root <- createRoot c
let app = actions { label: "Increment" }
in render app c
renderRoot root app
73 changes: 27 additions & 46 deletions examples/async/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/async/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"build": "spago build"
},
"dependencies": {
"react": "^17.0.1",
"react-dom": "^17.0.1"
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"parcel": "^2.6.0",
Expand Down
7 changes: 4 additions & 3 deletions examples/async/src/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import AsyncCounter (asyncCounter)
import Data.Maybe (Maybe(..))
import Effect (Effect)
import Effect.Exception (throw)
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)
Expand All @@ -17,6 +17,7 @@ main = do
container <- getElementById "container" =<< (map toNonElementParentNode $ document =<< window)
case container of
Nothing -> throw "Container element not found."
Just c ->
Just c -> do
root <- createRoot c
let app = asyncCounter { label: "Async Increment" }
in render app c
renderRoot root app
Loading

0 comments on commit 2e4aa5e

Please sign in to comment.