package server-reason-react

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

The React library

type domRef
type 'value ref = {
  1. mutable current : 'value;
}
module Ref : sig ... end
val createRef : unit -> 'a option ref
val useRef : 'a -> 'a ref
val forwardRef : (unit -> 'a) -> 'a
module Event : sig ... end
module JSX : sig ... end

All of those types are used by the server-reason-react.ppx internally to represent valid React code from the server. It currently different from reason-react-ppx due to a need for knowing the types since ReactDOM needs to render differently depending on the type.

type lower_case_element = {
  1. tag : string;
  2. attributes : JSX.prop list;
  3. children : element list;
}
and element =
  1. | Lower_case_element of lower_case_element
  2. | Upper_case_component of unit -> element
  3. | List of element array
  4. | Text of string
  5. | InnerHtml of string
  6. | Fragment of element
  7. | Empty
  8. | Provider of element
  9. | Consumer of element
  10. | Suspense of {
    1. children : element;
    2. fallback : element;
    }
exception Invalid_children of string
module Fragment : sig ... end
val createElement : string -> JSX.prop list -> element list -> element
val fragment : element -> element
val cloneElement : element -> JSX.prop list -> element
val string : string -> element
val null : element
val int : int -> element
val float : float -> element
val array : element array -> element
val list : element list -> element
type 'a provider = value:'a -> children:element -> unit -> element
type 'a context = {
  1. current_value : 'a ref;
  2. provider : 'a provider;
  3. consumer : children:element -> element;
}
module Context : sig ... end
val createContext : 'a -> 'a Context.t
module Suspense : sig ... end
type any_promise =
  1. | Any_promise : 'a Lwt.t -> any_promise
exception Suspend of any_promise
val useContext : 'a Context.t -> 'a
val useState : (unit -> 'state) -> 'state * (('state -> 'state) -> unit)
val useMemo : (unit -> 'a) -> 'a
val useMemo0 : (unit -> 'a) -> 'a
val useMemo1 : (unit -> 'a) -> 'b -> 'a
val useMemo2 : (unit -> 'a) -> 'b -> 'a
val useMemo3 : (unit -> 'a) -> 'b -> 'a
val useMemo4 : (unit -> 'a) -> 'b -> 'a
val useMemo5 : (unit -> 'a) -> 'b -> 'a
val useMemo6 : (unit -> 'a) -> 'b -> 'a
val useCallback : 'a -> 'a
val useCallback0 : 'a -> 'a
val useCallback1 : 'a -> 'b -> 'a
val useCallback2 : 'a -> 'b -> 'a
val useCallback3 : 'a -> 'b -> 'a
val useCallback4 : 'a -> 'b -> 'a
val useCallback5 : 'a -> 'b -> 'a
val useCallback6 : 'a -> 'b -> 'a
val useId : unit -> string
val useReducer : ('state -> 'action -> 'state) -> 'state -> 'state * ('action -> unit)
val useReducerWithMapState : ('state -> 'action -> 'initialState) -> 'initialState -> ('initialState -> 'state) -> 'state * ('action -> unit)
val useEffect : (unit -> (unit -> unit) option) -> unit
val useEffect0 : (unit -> (unit -> unit) option) -> unit
val useEffect1 : (unit -> (unit -> unit) option) -> 'dependency array -> unit
val useEffect2 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2) -> unit
val useEffect3 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3) -> unit
val useEffect4 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3 * 'dependency4) -> unit
val useEffect5 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3 * 'dependency4 * 'dependency5) -> unit
val useEffect6 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3 * 'dependency4 * 'dependency5 * 'dependency6) -> unit
val useLayoutEffect0 : (unit -> (unit -> unit) option) -> unit
val useLayoutEffect1 : (unit -> (unit -> unit) option) -> 'dependency array -> unit
val useLayoutEffect2 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2) -> unit
val useLayoutEffect3 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3) -> unit
val useLayoutEffect4 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3 * 'dependency4) -> unit
val useLayoutEffect5 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3 * 'dependency4 * 'dependency5) -> unit
val useLayoutEffect6 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3 * 'dependency4 * 'dependency5 * 'dependency6) -> unit
val setDisplayName : 'component -> string -> unit
module Children : sig ... end
module Experimental : sig ... end
val useTransition : unit -> bool * ((unit -> unit) -> unit)
val useDebugValue : 'value -> ?format:('value -> string) -> unit
val useDeferredValue : 'value -> 'value
OCaml

Innovation. Community. Security.