Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"purescript-dom": "^4.0.0",
"purescript-freet": "^3.0.0",
"purescript-profunctor-lenses": "^3.0.0",
"purescript-react-dom": "^4.0.0",
"purescript-react": "^4.0.0"
"purescript-react-dom": "^5.0.0",
"purescript-react": "^5.0.0"
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
"example": "pulp test -r cat > html/index.js"
},
"dependencies": {
"react": "^15.6.1",
"react-dom": "^15.6.1"
"create-react-class": "^15.6.2",
"react": "^16.0.0",
"react-dom": "^16.0.0"
},
"devDependencies": {
"pulp": "^11.0.0",
Expand Down
14 changes: 7 additions & 7 deletions src/Thermite.purs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ import Data.Maybe (Maybe(Just), fromMaybe)
import Data.Monoid (class Monoid)
import Data.Tuple (Tuple(..))
import React (createFactory)
import React.DOM (div')
import ReactDOM (render)

-- | A type synonym for an action handler, which takes an action, the current props
Expand Down Expand Up @@ -211,10 +210,10 @@ createReactSpec
:: forall eff state props action
. Spec eff state props action
-> state
-> { spec :: React.ReactSpec props state eff
-> { spec :: React.ReactSpec props state (Array React.ReactElement) eff
, dispatcher :: React.ReactThis props state -> action -> EventHandler
}
createReactSpec = createReactSpec' div'
createReactSpec = createReactSpec' id

-- | Create a React component spec from a Thermite component `Spec` with an additional
-- | function for converting the rendered Array of ReactElement's into a single ReactElement
Expand All @@ -224,11 +223,12 @@ createReactSpec = createReactSpec' div'
-- | component spec needs to be modified before being turned into a component class,
-- | e.g. by adding additional lifecycle methods.
createReactSpec'
:: forall eff state props action
. (Array React.ReactElement -> React.ReactElement)
:: forall eff state props render action
. (React.ReactRender render)
=> (Array React.ReactElement -> render)
-> Spec eff state props action
-> state
-> { spec :: React.ReactSpec props state eff
-> { spec :: React.ReactSpec props state render eff
, dispatcher :: React.ReactThis props state -> action -> EventHandler
}
createReactSpec' wrap (Spec spec) =
Expand Down Expand Up @@ -264,7 +264,7 @@ createReactSpec' wrap (Spec spec) =
-- functions do quite what we want here.
unsafeCoerceEff (launchAff (tailRecM step cotransformer))

render :: React.Render props state eff
render :: React.Render props state render eff
render this = map wrap $
spec.render (dispatcher this)
<$> React.getProps this
Expand Down