Module

ReactHocs.Context

Package
purescript-react-hocs
Repository
coot/purescript-react-hocs

#CONTEXT Source

data CONTEXT :: Effect

#withContext' Source

withContext' :: forall ctx props. (props -> ctx) -> ReactClass props -> ReactClass props

#withContext Source

withContext :: forall ctx props. ctx -> ReactClass props -> ReactClass props

#getFromContext Source

getFromContext :: forall ctx' ctx props' props. WithContextProps props' props ctx' => Lens' ctx ctx' -> ReactClass props -> ReactClass props'

#getContext Source

getContext :: forall ctx props' props. WithContextProps props' props ctx => Proxy ctx -> ReactClass props -> ReactClass props'

#accessContext Source

accessContext :: forall props. ReactClass props -> ReactClass props

This function mutates the component by adding contextTypes property.

#readContext Source

readContext :: forall ctx eff state props. Proxy ctx -> ReactThis props state -> Eff (context :: CONTEXT | eff) ctx

You can use it with components that were passed through accessContext.