Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 765 Bytes

React.module.md

File metadata and controls

27 lines (19 loc) · 765 Bytes

module React

Documentation / API Reference / React module

  • function Class

    • Signature: val Class : 'T -> (Class<'T> -> #Component) -> Class<'T, #Component)

    Creates a reactive component from an initial state of type 'T and from a renderer function, which maps the current state to a representation of the class being created.

React.Class { Name = "John" }
<| (fun this ->
    Text ("Hello " + this.State.Name + "!")
)
  • function Mount

    • Signature: val Mount : Dom.Node -> Component -> ReactComponent

    Mounts a Component instance into the given DOM node.

// a Class<_, _> instance
|> React.Mount Document.Body