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

Remove filtering of optional props in make_js_props_obj #89

Closed jchavarri closed 2 years ago

jchavarri commented 2 years ago

Fixes #83.

Optional props passed to uppercase components should be left as they are, no conversion to Js.Optdef.t required. The only exceptions are key and ref which are read by React.js.

Previous implementation led to bugs when using optional prop + default value, where the component would receive undefined when some value was passed (see added tests in test suite).

jchavarri commented 2 years ago

That's a great improvement.

Not possible without your help + work on lowercase comps optimizations! 🙂