Module

Solid.Web

Package
purescript-purs-solid
Repository
arazorda/purs-solid

Mounting views in the browser.

#isServer Source

isServer :: Effect Boolean

An Effect, so setup and views can't branch on it: a component must create the same primitives and markup on the server and in the browser, or hydration fails. onSettled callbacks only run in the browser, and Component.clientOnly renders content only there.

#ClientRenderOptions Source

type ClientRenderOptions :: Row Typetype ClientRenderOptions = (onError :: Error -> Effect Unit, owner :: Owner, renderId :: String)

#render Source

render :: JSX -> Element -> Effect (Either Error (Effect Unit))

Appends the view to mount's children. The result disposes it.

#renderWith Source

renderWith :: forall given missing. Union given missing ClientRenderOptions => Record given -> JSX -> Element -> Effect (Either Error (Effect Unit))

Takes any subset of ClientRenderOptions.

#hydrateWith Source

hydrateWith :: forall given missing. Union given missing ClientRenderOptions => Record given -> JSX -> Element -> Effect (Either Error (Effect Unit))

#mount Source

mount :: JSX -> Effect Unit

Renders view into document.body, for an app's main. Throws if that fails; render returns the error and a way to unmount instead.

#mountAt Source

mountAt :: String -> JSX -> Effect Unit

mount into the element with the given id.

#hydrateAt Source

hydrateAt :: String -> JSX -> Effect Unit

Hydrates the server-rendered element with the given id. Throws if that fails.