[Call for help #3] Test JSX v4

Since day one when I called for your help to test JSX v4, many feedbacks and issues helps to make a more concrete implementation and to fix it. I’d like to express my gratitude to all. We are ready for the third round of tests. We published the RC.3 version of compiler and React bindings to npm.

  • rescript@10.1.0-rc.3
  • @rescript/react@0.11.0-rc.3

You can install rescript@next and @rescript/react@next. Any issues or feedbacks are welcome.

You can activate the JSX v4 with below configuration:

  1. Remove the old configuration:

    "reason": {
      "react": 3
  2. New configuration:

    "jsx": {
      "version": 4,
      "mode": "classic" or "automatic"

    "automatic" is for the new jsx tranform API jsx

  3. If you want to keep using v3 with latest compiler and @rescript/react:

    "jsx": {
      "version": 3,
      "v3-dependencies": [ "rescript-relay" ]
    "bsc-flags": [ "-open ReactV3" ]

    To build certain dependencies in V3 compatibility mode, whatever the version used in the root project, use "v3-dependencies", except @rescript/react


I’ve just spent a few minutes trying to figure out what’s going on until noticed the name of the field “received” on the new line. Overall the error message looks better, but the line break is confusing.
Also, a comment about the If this is a component part, maybe we should specify that it’s about React components. The best would be to show the part only when jsx is enabled. I have nodejs projects where the React part is a little misleading.



Also, wrapping field names into quotes could make them more distinguishable.

1 Like