package server-reason-react

  1. Overview
  2. Docs
Rendering React components on the server natively

Install

Dune Dependency

Authors

Maintainers

Sources

server-reason-react-0.3.1.tbz
sha256=b97fbe6a7c3e5e1a7775e0f6498f257acaaa7e272177a9a3e0e50b7a49408d7c
sha512=b27a94618c367c80efef83a41c2a59c9cc7848fd753049ed40fa1f2cface1ef34cf3a995835bf08e2eb59c3186911f429b4706ed07dcb9724df6af5eb012a31d

doc/server-reason-react.react/React/index.html

Module ReactSource

The React library

Sourcetype domRef
Sourcetype 'value ref = {
  1. mutable current : 'value;
}
Sourcemodule Ref : sig ... end
Sourceval createRef : unit -> 'a option ref
Sourceval useRef : 'a -> 'a ref
Sourceval forwardRef : (unit -> 'a) -> 'a
Sourcemodule Event : sig ... end
Sourcemodule 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.

Sourcetype lower_case_element = {
  1. tag : string;
  2. attributes : JSX.prop list;
  3. children : element list;
}
Sourceand 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;
    }
Sourceexception Invalid_children of string
Sourcemodule Fragment : sig ... end
Sourceval createElement : string -> JSX.prop list -> element list -> element
Sourceval fragment : element -> element
Sourceval cloneElement : element -> JSX.prop list -> element
Sourceval string : string -> element
Sourceval null : element
Sourceval int : int -> element
Sourceval float : float -> element
Sourceval array : element array -> element
Sourceval list : element list -> element
Sourcetype 'a provider = value:'a -> children:element -> unit -> element
Sourcetype 'a context = {
  1. current_value : 'a ref;
  2. provider : 'a provider;
  3. consumer : children:element -> element;
}
Sourcemodule Context : sig ... end
Sourceval createContext : 'a -> 'a Context.t
Sourcemodule Suspense : sig ... end
Sourcetype any_promise =
  1. | Any_promise : 'a Lwt.t -> any_promise
Sourceexception Suspend of any_promise
Sourceval useContext : 'a Context.t -> 'a
Sourceval useState : (unit -> 'state) -> 'state * (('state -> 'state) -> unit)
Sourceval useMemo : (unit -> 'a) -> 'a
Sourceval useMemo0 : (unit -> 'a) -> 'a
Sourceval useMemo1 : (unit -> 'a) -> 'b -> 'a
Sourceval useMemo2 : (unit -> 'a) -> 'b -> 'a
Sourceval useMemo3 : (unit -> 'a) -> 'b -> 'a
Sourceval useMemo4 : (unit -> 'a) -> 'b -> 'a
Sourceval useMemo5 : (unit -> 'a) -> 'b -> 'a
Sourceval useMemo6 : (unit -> 'a) -> 'b -> 'a
Sourceval useCallback : 'a -> 'a
Sourceval useCallback0 : 'a -> 'a
Sourceval useCallback1 : 'a -> 'b -> 'a
Sourceval useCallback2 : 'a -> 'b -> 'a
Sourceval useCallback3 : 'a -> 'b -> 'a
Sourceval useCallback4 : 'a -> 'b -> 'a
Sourceval useCallback5 : 'a -> 'b -> 'a
Sourceval useCallback6 : 'a -> 'b -> 'a
Sourceval useId : unit -> string
Sourceval useReducer : ('state -> 'action -> 'state) -> 'state -> 'state * ('action -> unit)
Sourceval useReducerWithMapState : ('state -> 'action -> 'initialState) -> 'initialState -> ('initialState -> 'state) -> 'state * ('action -> unit)
Sourceval useEffect : (unit -> (unit -> unit) option) -> unit
Sourceval useEffect0 : (unit -> (unit -> unit) option) -> unit
Sourceval useEffect1 : (unit -> (unit -> unit) option) -> 'dependency array -> unit
Sourceval useEffect2 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2) -> unit
Sourceval useEffect3 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3) -> unit
Sourceval useEffect4 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3 * 'dependency4) -> unit
Sourceval useEffect5 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3 * 'dependency4 * 'dependency5) -> unit
Sourceval useEffect6 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3 * 'dependency4 * 'dependency5 * 'dependency6) -> unit
Sourceval useLayoutEffect0 : (unit -> (unit -> unit) option) -> unit
Sourceval useLayoutEffect1 : (unit -> (unit -> unit) option) -> 'dependency array -> unit
Sourceval useLayoutEffect2 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2) -> unit
Sourceval useLayoutEffect3 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3) -> unit
Sourceval useLayoutEffect4 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3 * 'dependency4) -> unit
Sourceval useLayoutEffect5 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3 * 'dependency4 * 'dependency5) -> unit
Sourceval useLayoutEffect6 : (unit -> (unit -> unit) option) -> ('dependency1 * 'dependency2 * 'dependency3 * 'dependency4 * 'dependency5 * 'dependency6) -> unit
Sourceval setDisplayName : 'component -> string -> unit
Sourcemodule Children : sig ... end
Sourcemodule Experimental : sig ... end
Sourceval useTransition : unit -> bool * ((unit -> unit) -> unit)
Sourceval useDebugValue : 'value -> ?format:('value -> string) -> unit
Sourceval useDeferredValue : 'value -> 'value
OCaml

Innovation. Community. Security.