If you put [@reason.component] in the wrong location it will give a very confusing and uninformative error. This took me a couple hours to track down properly:
Example of problematic code:
[@react.component]`
let (pageState,setPageState) = React.useState(_ => testState);
let make { ...}
For me at least in an error message in the associated dune file was given, nowhere near where the issue was -- nor obviously related to incorrect ppx directives:
7 | (preprocess (pps melange.ppx reason-react-ppx)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fatal error: exception Invalid_argument("react.component calls cannot be destructured."