ml-in-barcelona / jsoo-react

js_of_ocaml bindings for ReactJS. Based on ReasonReact.
https://ml-in-barcelona.github.io/jsoo-react
MIT License
138 stars 19 forks source link

refactor: require `react`, `react-dom` within OCaml #96

Closed zbaylin closed 2 years ago

zbaylin commented 2 years ago

This removes the need to set React globally using a file similar to examples/src/react-requires.js.

Rather than gen_js_api referring to a global named React/ReactDOM, we import the libraries once using require and partially apply js.calls

Thanks @jchavarri for the help with this!

jchavarri commented 2 years ago

Thanks again @zbaylin for working on this! 🎸 Merging