Module

Reactix.React

Package
purescript-reactix
Repository
garganscript/purescript-reactix

#React Source

data React

#ReactDOM Source

#render Source

render :: Element -> Element -> Effect Unit

Renders a React Element to a real Element

#Element Source

data Element

A React Element node

Instances

#unsafeHooksEffect Source

unsafeHooksEffect :: forall a. Effect a -> Hooks a

#runHooks Source

runHooks :: forall a. Hooks a -> Effect a

#Context Source

data Context t0

A React Context

#createContext Source

createContext :: forall v. v -> Context v

Creates a Context from a given value

#provideContext Source

provideContext :: forall v. Context v -> v -> Array Element -> Element

#consumeContext Source

consumeContext :: forall v. Context v -> (v -> Element) -> Element

#Provider Source

data Provider t0

The Provider for a React Context

Instances

#provider Source

provider :: forall v. Context v -> Provider v

#provide Source

provide :: forall v. Provider v -> v -> Array Element -> Element

#Consumer Source

data Consumer t0

The Consumer for a React Context

Instances

#consumer Source

consumer :: forall v. Context v -> Consumer v

#consume Source

consume :: forall v. Consumer v -> (v -> Element) -> Element

#IsComponent Source

class IsComponent :: Type -> Row Type -> Type -> Constraintclass IsComponent component (props :: Row Type) children | component -> props, component -> children where

Members

Instances

#Component Source

newtype Component :: Row Type -> Typenewtype Component props

Instances

#createDOMElement Source

#rawCreateElement Source

rawCreateElement :: forall c p cs. c -> p -> Array cs -> Element

#StaticComponent Source

#staticComponent Source

staticComponent :: forall props. String -> StaticComponent props -> Component props

Turns a StaticComponent function into a Component

#staticComponentWithModule Source

staticComponentWithModule :: forall props. Module -> String -> StaticComponent props -> Component props

#HooksComponent Source

type HooksComponent :: Row Type -> Typetype HooksComponent props = Record props -> Array Element -> Hooks Element

The type of a function that can be turned into a component with hooksComponent. Will have access to the Hooks Monad.

#hooksComponent Source

hooksComponent :: forall props. String -> HooksComponent props -> Component props

Turns a HooksComponent function into a Component

#hooksComponentWithModule Source

hooksComponentWithModule :: forall props. Module -> String -> HooksComponent props -> Component props

#fragment Source

fragment :: Array Element -> Element

Clones an element. Quite unsafe because tripping through Element loses the type of the props. Be careful. Combines several elements together

#MonadDelay Source

class MonadDelay :: (Type -> Type) -> Constraintclass (Monad m) <= MonadDelay m 

This class is for Monads whose side effect includes delayed computation. So far, it's Effect and Hooks.

Instances

#Ref Source

data Ref t0

#createRef Source

createRef :: forall r. Unit -> NullableRef r

#readRef Source

readRef :: forall r. Ref r -> r

#readRefM Source

readRefM :: forall r m. MonadDelay m => Ref r -> m r

#readNullableRef Source

readNullableRef :: forall r. Ref (Nullable r) -> Maybe r

#readNullableRefM Source

readNullableRefM :: forall r m. MonadDelay m => Ref (Nullable r) -> Effect (Maybe r)

#setRef Source

setRef :: forall r. Ref r -> r -> Effect Unit

#isValid Source

isValid :: forall a. a -> Boolean

#Memo Source

data Memo :: Row Type -> Typedata Memo t0

Instances

#memo Source

memo :: forall props. Component props -> (Record props -> Record props -> Boolean) -> Memo props

#memo' Source

memo' :: forall props. Component props -> Memo props