Thanks to @alexfedoseev in the ReasonML Discord channel:
In JS, click / blur / focus are methods on DOM element object. In Reason, one must use the appropriate functions to call these methods.
There exist 2 ways to achieve it:
- Less type-safe, provided by ReasonReact:
->Option.map(el => el->ReactDOMRe.domElementToObj##click())
- Type-safe, but requires Webapi package:
PSA: If you frequent the ReasonML Discord channel and found this helpful, please consider adding answers received via chat (especially those likely to get asked frequently) to the ReasonML.chat forum. Hopefully this will reduce the load on those providing help in the Discord channel, and make the learning curve a bit shallower for those Googling for help.