Skip to content

Commit

Permalink
Merge pull request #180 from ml-in-barcelona/davesnx-patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
davesnx committed Apr 19, 2023
2 parents 57f42eb + c8505ae commit aa0c590
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

[![Actions Status](https://github.com/ml-in-barcelona/jsoo-react/workflows/CI/badge.svg?branch=main)](https://github.com/ml-in-barcelona/jsoo-react/actions?query=branch%3Amain)

Bindings to [React](https://reactjs.org/) for [js_of_ocaml](https://ocsigen.org/js_of_ocaml/), including JSX ppx.
Bindings to [React](https://reactjs.org/) for [js_of_ocaml](https://ocsigen.org/js_of_ocaml/), including the JSX ppx.

Adapted from [ReasonReact](https://github.com/reasonml/reason-react/).
> **Status**: experimental phase
>
> The library is expected to break backwards compatibility on minor releases.
`jsoo-react` allows to use React from OCaml, but it is still at the **experimental** phase: there is no published version in [opam](opam.ocaml.org/) yet, and the library is expected to break backwards compatibility often.
Adapted from [ReasonReact](https://github.com/reasonml/reason-react/).

Bug reports and contributions are welcome!

Expand All @@ -21,22 +23,22 @@ For new projects, the best way to start is by using [the jsoo-react template](ht
1. Install the `jsoo-react` package:

```bash
opam pin add -y jsoo-react https://github.com/ml-in-barcelona/jsoo-react.git
opam install jsoo-react
```

2. Add `jsoo-react` library and ppx to [dune](https://dune.readthedocs.io/en/stable/) file of your executable JavaScript app:

```
(executables
(names index)
(modes js)
(libraries jsoo-react.lib)
(preprocess
(pps jsoo-react.ppx)))
```dune
(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`.
Expand Down

0 comments on commit aa0c590

Please sign in to comment.