Disable react-jsx per file

Is there a way to disable react-jsx transformation in some files of a ReasonReact project?

I think the other way around is possible by not adding "reason": { "react-jsx": 3 } to bsconfig.json and by adding @@bs.config({jsx: 3}) to the top of the files where you want react-jsx transformation, but that would force me to add this annotation in too many files.

I’d like to build a small DSL based on JSX in a few files while benefiting from React in the rest of my project.

1 Like

I also asked on stackoverflow since the question and answers would be relevant there IMHO:

@Hongbo sorry to ping you about that, but apparently no one can answer my question so you’re my last hope :smiley:

IIUC, you are trying to make use of the sugar provided by the old reason syntax?
e.g,

<hello x="gsho"> </hello>

You want it to not be transformed by react-ppx?

Basically, is there a way in Rescript to use JSX for something not related to React, like Revery does in Reason native? And if possible, is there a way to have both in the same project?

The docs (https://rescript-lang.org/docs/manual/latest/jsx) made me think ReasonReact makes a different transformation that prevents from using JSX with a custom logic but maybe I’m wrong.

No way to disable per-file right now