package server-reason-react
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=3972f64a3ec22b120b40137f74e7862629b2164e5bbf8b85489d4c7b8bc13288
sha512=24a52537c091c4b278ea5e468aa6786378f8b559ed2128e824b6f84f26c283856a30e7ef01aab6101087bd53b9bdc2ecd8152c00db10bccff67221b9c67318a0
doc/server-reason-react.react/React/index.html
Module ReactSource
The React library
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.
and element = | Lower_case_element of lower_case_element| Upper_case_component of string * unit -> element| Async_component of string * unit -> element Lwt.t| Client_component of {key : string option;props : client_props;client : element;import_module : string;import_name : string;
}| List of element list| Array of element array| Text of string| Int of int| Float of float| Static of {prerendered : string;original : element;
}| Writer of {}(*Subtree with static skeleton + dynamic string/int/float/element holes.
emitwrites directly into the caller's buffer, avoiding the intermediate buffer + Buffer.contents allocation that aStaticwrapping would require.separatorstells the emit function whether adjacent text nodes must be delimited with an<!-- -->comment, matching react-dom:renderToStringneeds the delimiters so hydration can split merged text nodes,renderToStaticMarkupmust not emit them.
*)originalis a thunk that rebuilds the variant-tree form on-demand forcloneElement/ RSC consumers. Same name asStatic.originalfor symmetry; this variant's version is lazy. Emitted by the PPX for theNeeds_string_concatandNeeds_bufferanalysis tiers.| Fragment of element| Empty| Provider of {}| Consumer of element| Suspense of {}
Signatures match reason-react. On the server there's no re-render, so memoization is a no-op: the component is returned unchanged and the compare function is ignored.
Rendering hook context — called by the renderer before/after rendering each function component.
Process-global: two async renders must not be in flight concurrently in one process, or their useId state corrupts each other at Lwt yields.
Generates a stable id for the current render.
Relies on process-global state (current_tree_context et al.): only one async render may be in flight per process, otherwise concurrent renders interleave at Lwt yields and produce hydration mismatches.
val useSyncExternalStore :
subscribe:((unit -> unit) -> (unit, unit) callback) ->
getSnapshot:(unit -> 'snapshot) ->
'snapshotval useReducerWithMapState :
('state -> 'action -> 'initialState) ->
'initialState ->
('initialState -> 'state) ->
'state * ('action -> unit)val useEffect3 :
(unit -> (unit -> unit) option) ->
('dependency1 * 'dependency2 * 'dependency3) ->
unitval useEffect4 :
(unit -> (unit -> unit) option) ->
('dependency1 * 'dependency2 * 'dependency3 * 'dependency4) ->
unitval useEffect5 :
(unit -> (unit -> unit) option) ->
('dependency1 * 'dependency2 * 'dependency3 * 'dependency4 * 'dependency5) ->
unitval useEffect6 :
(unit -> (unit -> unit) option) ->
('dependency1
* 'dependency2
* 'dependency3
* 'dependency4
* 'dependency5
* 'dependency6) ->
unitval useLayoutEffect2 :
(unit -> (unit -> unit) option) ->
('dependency1 * 'dependency2) ->
unitval useLayoutEffect3 :
(unit -> (unit -> unit) option) ->
('dependency1 * 'dependency2 * 'dependency3) ->
unitval useLayoutEffect4 :
(unit -> (unit -> unit) option) ->
('dependency1 * 'dependency2 * 'dependency3 * 'dependency4) ->
unitval useLayoutEffect5 :
(unit -> (unit -> unit) option) ->
('dependency1 * 'dependency2 * 'dependency3 * 'dependency4 * 'dependency5) ->
unitval useLayoutEffect6 :
(unit -> (unit -> unit) option) ->
('dependency1
* 'dependency2
* 'dependency3
* 'dependency4
* 'dependency5
* 'dependency6) ->
unit