ml-in-barcelona/jsoo-react

js_of_ocaml bindings for ReactJS. Based on ReasonReact.

138

stars

647

commits

OCaml

primary language

May 20, 2025

updated

ml-in-barcelona.github.io/jsoo-react
js-of-ocaml
ocaml
ppx
react
reasonml

README

jsoo-react

Actions Status

Bindings to React for js_of_ocaml, including the JSX ppx.

Status: experimental phase

The library is expected to break backwards compatibility on minor releases.

Adapted from ReasonReact.

Bug reports and contributions are welcome!

Getting started

New project

For new projects, the best way to start is by using the jsoo-react template.

Existing project

  1. Install the jsoo-react package:

    opam install jsoo-react
    
  2. Add jsoo-react library and ppx to dune file of your executable JavaScript app:

        (executables
        (names index)
        (modes js)
        (libraries jsoo-react.lib)
        (preprocess
        (pps jsoo-react.ppx)))
    
  3. Provision React.js library

    jsoo-react uses require to import React and ReactDOM. This means that you will likely need to use a bundler such as Webpack or rollup.js.

    Note that at this moment, jsoo-react is compatible with React 16, so be sure to have the appropriate constraints in your package.json.

Contributing

Take a look at our Contributing Guide.

Acknowledgements

Thanks to the authors and maintainers of ReasonReact, in particular @rickyvetter for his work on the v3 of the JSX ppx.

Thanks to the authors and maintainers of Js_of_ocaml, in particular @hhugo who has been answering many many questions in GitHub threads.

Thanks to the Lexifi team for creating and maintaining gen_js_api.

Thanks to @tmattio for creating Spin and the jsoo-react template :raised_hands:

And thanks to the team behind React.js! What an amazing library :)

Contributors

jchavarri

359 commits

glennsl

140 commits

davesnx

107 commits

zbaylin

13 commits

ml-in-barcelona/jsoo-react

js_of_ocaml bindings for ReactJS. Based on ReasonReact.

138

stars

647

commits

OCaml

primary language

May 20, 2025

updated

ml-in-barcelona.github.io/jsoo-react
js-of-ocaml
ocaml
ppx
react
reasonml

README

jsoo-react

Actions Status

Bindings to React for js_of_ocaml, including the JSX ppx.

Status: experimental phase

The library is expected to break backwards compatibility on minor releases.

Adapted from ReasonReact.

Bug reports and contributions are welcome!

Getting started

New project

For new projects, the best way to start is by using the jsoo-react template.

Existing project

  1. Install the jsoo-react package:

    opam install jsoo-react
    
  2. Add jsoo-react library and ppx to dune file of your executable JavaScript app:

        (executables
        (names index)
        (modes js)
        (libraries jsoo-react.lib)
        (preprocess
        (pps jsoo-react.ppx)))
    
  3. Provision React.js library

    jsoo-react uses require to import React and ReactDOM. This means that you will likely need to use a bundler such as Webpack or rollup.js.

    Note that at this moment, jsoo-react is compatible with React 16, so be sure to have the appropriate constraints in your package.json.

Contributing

Take a look at our Contributing Guide.

Acknowledgements

Thanks to the authors and maintainers of ReasonReact, in particular @rickyvetter for his work on the v3 of the JSX ppx.

Thanks to the authors and maintainers of Js_of_ocaml, in particular @hhugo who has been answering many many questions in GitHub threads.

Thanks to the Lexifi team for creating and maintaining gen_js_api.

Thanks to @tmattio for creating Spin and the jsoo-react template :raised_hands:

And thanks to the team behind React.js! What an amazing library :)

Contributors

jchavarri

359 commits

glennsl

140 commits

davesnx

107 commits

zbaylin

13 commits

Languages

OCaml

79.1%

Reason

12.1%

CSS

4.5%

JavaScript

3.3%