Module

React.Router.Components

Package
purescript-cofree-react-router
Repository
coot/purescript-cofree-react-router

#Location Source

newtype Location

RouterState type

#BrowserRouter Source

newtype BrowserRouter props arg notFoundProps

BrowserRouter prop type

Constructors

#browserRouter Source

browserRouter :: forall notfound arg props eff. RoutePropsClass props arg => ReactSpec (BrowserRouter props arg notfound) Location (console :: CONSOLE, dom :: DOM, history :: HISTORY | eff)

ReactSpec for the browserRouterClass - the main entry point react class for the router.

#browserRouterClass Source

browserRouterClass :: forall notfound arg props. RoutePropsClass props arg => ReactClass (BrowserRouter props arg notfound)

React class for the browerRouter element. Use it to init your application.

 router = ... :: Router _
 main = void $ elm >>= render (createElement browserRouterClass {router, notFound: Nothing} [])
   where
     elm = do
       elm_ <- window >>= document >>= getElementById (ElementId "app") <<< documentToNonElementParentNode <<< htmlDocumentToDocument
       pure $ unsafePartial fromJust (toMaybe elm_)
 ```

#LinkProps Source

newtype LinkProps eff

Constructors

#linkSpec Source

linkSpec :: forall eff. ReactSpec (LinkProps eff) Unit ()

ReactSpec for the link element; it takes a record of type LinkProps as properties. The props record property is directly passed to underlying a element, e.g. this can be used to add css classes.

#linkClass Source

linkClass :: forall eff. ReactClass (LinkProps eff)

React class for the link element.

#link' Source

link' :: RouterConfig -> URL -> Array ReactElement -> ReactElement

as link, but with empty props.

#goto Source

goto :: forall eff. RouterConfig -> URL -> Eff (console :: CONSOLE, dom :: DOM, history :: HISTORY | eff) Unit

goto url