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.1.tbz
sha256=2d27cb4656208dde8d5eb0c452c590186d092618ac0a04f1ab0a095a3ca58498
sha512=26e16daf87f6b80eff86ccf7df29153527b24e3f4dbc7f13820d1507b0a2e7d6db40fd774bcaad6e6cccff0bf19d4a411b95a10a071f9ce92d52bf07eb08f75f

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)