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

Go to definition doesn't work inside let%component #121

Closed jchavarri closed 2 years ago

jchavarri commented 2 years ago

When playing around with @glennsl 's code being developed in https://github.com/ml-in-barcelona/jsoo-react/pull/119, I noticed it is not possible to go to function definitions of either elements (div, a), or props "makers" (className, id).

I avoided this when we were using @@@react.dom preprocessing, but with the changes in PR linked above it becomes easier to track down the problem: the ppx should not intervene in any inner parts of the component, just wrap the implementation with what is needed (createElement, JS props make function, etc) and leave any locations in the implementation code as is.

Note the issue could be either that:

I tend to think the problem might be the latter 🤔 but this needs investigation.