package server-reason-react

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

Install

dune-project
 Dependency

Authors

Maintainers

Sources

server-reason-react-0.4.0.tbz
sha256=7811cd16a7256edbebd06057072142fc2fa1d81de784442e21f3225f06f08ce2
sha512=d60084b34f4086bc401f5f1e209714ab297b5dd94b9b55050816ba9dd0579b2c88745b1813ab57d9584c826af9602df279e8ecfdc04cde62f94d1fec9506dd45

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 error = {
  1. message : string;
  2. stack : Yojson.Basic.t;
  3. env : string;
  4. digest : string;
}
Sourcemodule Model : sig ... end
Sourcetype element =
  1. | Lower_case_element of lower_case_element
  2. | Upper_case_component of string * unit -> element
  3. | Async_component of string * unit -> element Lwt.t
  4. | Client_component of {
    1. props : client_props;
    2. client : element;
    3. import_module : string;
    4. import_name : string;
    }
  5. | List of element list
  6. | Array of element array
  7. | Text of string
  8. | DangerouslyInnerHtml of string
  9. | Fragment of element
  10. | Empty
  11. | Provider of element
  12. | Consumer of element
  13. | Suspense of {
    1. key : string option;
    2. children : element;
    3. fallback : element;
    }
Sourceand lower_case_element = {
  1. key : string option;
  2. tag : string;
  3. attributes : JSX.prop list;
  4. children : element list;
}
Sourceand client_props = (string * element Model.t) list
Sourceand model_value = element Model.t
Sourceexception Invalid_children of string
Sourcemodule Fragment : sig ... end
Sourceval createElement : string -> JSX.prop list -> element list -> element
Sourceval createElementWithKey : ?key:string -> 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
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
Sourcetype ('input, 'output) callback = 'input -> 'output
Sourceval useSyncExternalStore : subscribe:((unit -> unit) -> (unit, unit) callback) -> getSnapshot:(unit -> 'snapshot) -> 'snapshot
  • deprecated Use useSyncExternalStoreWithServer instead
Sourceval useSyncExternalStoreWithServer : subscribe:((unit -> unit) -> (unit, unit) callback) -> getSnapshot:(unit -> 'snapshot) -> getServerSnapshot:(unit -> 'snapshot) -> 'snapshot
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
Sourceval suspend : 'a Lwt.t -> unit
Sourcemodule Experimental : sig ... end
Sourceval useTransition : unit -> bool * ((unit -> unit) -> unit)
Sourceval useDebugValue : 'value -> ?format:('value -> string) -> unit
Sourceval useDeferredValue : 'value -> 'value