@@ -1,22 +1,20 @@
1module Main where
1module Main where
3−import Prelude
3+import Prelude.Default
5−import Data.Maybe (Maybe(..))
5+import Components.Example as Example
7import Effect.Exception (throw)
6import Effect.Exception (throw)
8import React.Basic (JSX)
7import React.Basic (JSX)
9import React.Basic.DOM (render)
8import React.Basic.DOM (render)
10−import React.Basic.DOM as R
11import Web.DOM (Element)
9import Web.DOM (Element)
12import Web.DOM.NonElementParentNode (getElementById)
10import Web.DOM.NonElementParentNode (getElementById)
13import Web.HTML (window)
11import Web.HTML (window)
14import Web.HTML.HTMLDocument (toNonElementParentNode)
12import Web.HTML.HTMLDocument (toNonElementParentNode)
15import Web.HTML.Window (document)
13import Web.HTML.Window (document)
17−-- | The main JSX/React Component for this single-page-application.
15+-- | Constructs the main React Component for this single-page-application.
18−app :: JSX
16+mkApp :: Effect JSX
19−app = R.text "Hello, PureScript!"
17+mkApp = Example.component <#> (_ $ 0)
21-- | The id of the HTML element which will wrap the React App.
19-- | The id of the HTML element which will wrap the React App.
22-- | It needs to match your `index.html` file, for example:
20-- | It needs to match your `index.html` file, for example:
@@ -31,6 +29,7 @@ containerId = "container"
31main :: Effect Unit
29main :: Effect Unit
33 container <- getContainerById containerId
31 container <- getContainerById containerId
34 render app container
33 render app container
36-- | Finds an Element based on its ID in
35-- | Finds an Element based on its ID in