This has nothing to do with JSX or plain function calls. It’s because ReScript 11 still compiles to var assignments. If you change the vars in the compiled output JSX file to let, it should work.
- var match = React.useState(function () {
+ let match = React.useState(function () {
return 0;
});
- var setState = match[1];
+ let setState = match[1];
ReScript 12 will compile to let: Back-end: emit `let` instead of `var`. by cristianoc · Pull Request #6102 · rescript-lang/rescript-compiler · GitHub
