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/src/server-reason-react.runtime/Runtime.ml.html

Source file Runtime.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
exception Impossible_in_ssr of string

let fail_impossible_action_in_ssr fn =
  let backtrace = Printexc.get_callstack 8 in
  let raw_callstack = Printexc.raw_backtrace_to_string backtrace in
  let () =
    Printf.printf
      {|'%s' should only run on the client. Make sure you aren't accidentally calling this function in a server-side context.

Here's the raw callstack:

%s
|}
      fn raw_callstack
  in
  raise
    (Impossible_in_ssr (Printf.sprintf {|'%s' shouldn't run on the server|} fn))

type platform = Server | Client
OCaml

Innovation. Community. Security.