This is the documentation and API for server-reason-react, an implementation of react, react-dom and react-dom/server to run on the server with Reason/OCaml, with the purpose to Server-side render HTML markup from a reason-react application natively (for both SSR and SSG).
The entire model is designed to share components (and code) between the client and the server. To achieve this goal server-reason-react also contains other libraries and ppxes that are useful to share code between the two architectures. Makes rendering React components on the server much simpler.
Explained more about the motivation in this blog post sancho.dev/blog/server-side-rendering-react-in-ocaml and also in my talk about Server side rendering React natively with Reason at ReactAlicante 2023.
Those are the core libraries of server-reason-react.
React The React libraryreactDom Aside from the core, server-reason-react exposes some needed known libraryes from melange or melange-community to help make components universal.
Belt server-reason-react.belt (equivalent to Belt from melange)Js server-reason-react.js (equivalent to Js from melange, very unsafe)URL server-reason-react.urlWebapi server-reason-react.webapi (equivalent to Webapi from melange-webapi)This would eventually be extracted into their own packages