Main: restore the routing, componentWillMount is now called unsafeComponentWillMount

parent 8ab40841
...@@ -19,8 +19,8 @@ import Web.HTML (window) ...@@ -19,8 +19,8 @@ import Web.HTML (window)
import Web.HTML.Window (document) import Web.HTML.Window (document)
import Web.HTML.HTMLDocument (toParentNode) import Web.HTML.HTMLDocument (toParentNode)
setComponentWillMount :: forall s. Effect Unit -> Record s -> Record (componentWillMount :: Effect Unit | s) setUnsafeComponentWillMount :: forall s. Effect Unit -> Record s -> Record (unsafeComponentWillMount :: Effect Unit | s)
setComponentWillMount = unsafeSet "componentWillMount" setUnsafeComponentWillMount = unsafeSet "unsafeComponentWillMount"
main :: Effect Unit main :: Effect Unit
main = do main = do
...@@ -28,7 +28,7 @@ main = do ...@@ -28,7 +28,7 @@ main = do
{ spec, dispatcher } -> void $ do { spec, dispatcher } -> void $ do
let setRouting this = void $ do let setRouting this = void $ do
matches routing (routeHandler (dispatchAction (dispatcher this))) matches routing (routeHandler (dispatchAction (dispatcher this)))
spec' this = setComponentWillMount (setRouting this) <$> (spec this) spec' this = setUnsafeComponentWillMount (setRouting this) <$> (spec this)
document <- window >>= document document <- window >>= document
container <- unsafePartial (fromJust <$> querySelector (QuerySelector "#app") (toParentNode document)) container <- unsafePartial (fromJust <$> querySelector (QuerySelector "#app") (toParentNode document))
h <- getHash h <- getHash
...@@ -37,5 +37,5 @@ main = do ...@@ -37,5 +37,5 @@ main = do
_ -> do _ -> do
setHash "/" setHash "/"
setHash h setHash h
let e = R.unsafeCreateElement (R.component "GargantextMain" spec) {} [] let e = R.unsafeCreateElement (R.component "GargantextMain" spec') {} []
RDOM.render e container RDOM.render e container
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment