Module
React.Router.Components
- Package
- purescript-cofree-react-router
- Repository
- coot/purescript-cofree-react-router
#browserRouter Source
browserRouter :: forall notfound args props eff. RoutePropsClass props => ReactSpec (RouterProps props args notfound) RouterState (dom :: DOM, history :: HISTORY | eff)
ReactSpec
for the browserRouterClass
- the main entry point react
class for the router.
#browserRouterClass Source
browserRouterClass :: forall notfound args props. RoutePropsClass props => ReactClass (RouterProps props args 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_)
```
#link Source
link :: LinkProps -> Array ReactElement -> ReactElement
link
element; use it instead of a
to route the user through application.
#link' Source
link' :: String -> Array ReactElement -> ReactElement
as link
, but with empty properties passed to the underlying a
element.