package brisk-reconciler

  1. Overview
  2. Docs
module GlobalState : sig ... end

Global state, mainly useful for internal testing

type handler = unit -> unit
type unregisterF = handler
val addStaleTreeHandler : handler -> unregisterF
module Key : sig ... end

Component keys

type 'node element

Type of element returned from render

type ('node, 'childNode) hostNodeElement = {
  1. make : unit -> 'node;
  2. configureInstance : isFirstRender:bool -> 'node -> 'node;
  3. children : 'childNode element;
  4. insertNode : parent:'node -> child:'childNode -> position:int -> 'node;
  5. deleteNode : parent:'node -> child:'childNode -> position:int -> 'node;
  6. moveNode : parent:'node -> child:'childNode -> from:int -> to_:int -> 'node;
}

Type of element that renders OutputTree.node

val listToElement : 'a element list -> 'a element

Converts a list of elements to a single syntheticElement. Lists use a mix of positoinal and keys to determine if a component should be inserted, removed, or updated. For two lists with the same length (i.e. if chicldren have the same length before and after update) if a component has a key, it'll be updated if there was a component with the same key on the previous render. Components without a key are matched based on position. Lists with different lengths are updated only based on keys.

val empty : 'a element

Empty synthetic element.

module RenderedElement : sig ... end
val component : ?useDynamicKey:bool -> string -> ?key:Key.t -> (('a, 'a) Hooks.t -> (Hooks.nil, 'a) Hooks.t * 'node element) -> 'node element

Creates a component. Components are functions which retain state over time via Hooks. The function you pass to component should be pure and all side effects should be handled using Hooks.effect

  • deprecated Use let%component instead.
val nativeComponent : ?useDynamicKey:bool -> string -> ?key:Key.t -> (('a, 'a) Hooks.t -> (Hooks.nil, 'a) Hooks.t * ('node, 'childNode) hostNodeElement) -> 'node element

Creates a component which renders an OutputTree node.

  • deprecated Use let%nativeComponent instead.
module Expert : sig ... end
module Hooks : sig ... end
module Remote_action : sig ... end
module RemoteAction = Remote_action
OCaml

Innovation. Community. Security.