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.5.1.tbz
sha256=3972f64a3ec22b120b40137f74e7862629b2164e5bbf8b85489d4c7b8bc13288
sha512=24a52537c091c4b278ea5e468aa6786378f8b559ed2128e824b6f84f26c283856a30e7ef01aab6101087bd53b9bdc2ecd8152c00db10bccff67221b9c67318a0

doc/server-reason-react.runtime/Runtime/index.html

Module RuntimeSource

A small utility to raise issues with SSR

Mostly used internally by the ppxes

Sourceexception Impossible_in_ssr of string

Exception to throw when operations aren't meant to be running on native, mostly used by browser_ppx or ReactDOM

Sourceval fail_impossible_action_in_ssr : string -> 'a
Sourcetype platform =
  1. | Server
  2. | Client
    (*

    `Runtime.platform` is required to use switch%platform. It's a simple variant that expresses the 2 platforms

    *)
Sourcetype 'callback server_function = {
  1. id : string;
  2. call : 'callback;
}

Type for server actions contract.

The 'callback function must to be uncurried as we don't know the amount of arguments.

  • id: Server Function ID, this will be used on server only
  • call: The Server function implementation

E.g. React.server_function(. ~name: string, ~age: int) => Js.Promise.t(string)