From 30c7c3c8a62b8477eddff57eb528d4d5054c62c1 Mon Sep 17 00:00:00 2001 From: Sahil Bhandare <125137642+sahilbhandare45@users.noreply.github.com> Date: Sat, 10 Oct 2026 00:59:43 +0530 Subject: [PATCH] Clarify JSX parsing with Babel in installation guide Add note about JSX parsing requirements when using Babel. --- src/content/learn/react-compiler/installation.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/content/learn/react-compiler/installation.md b/src/content/learn/react-compiler/installation.md index b386e866ea3..de151b513f2 100644 --- a/src/content/learn/react-compiler/installation.md +++ b/src/content/learn/react-compiler/installation.md @@ -62,6 +62,10 @@ module.exports = { }; ``` + +The compiler plugin does not turn on JSX parsing by itself. If you run Babel directly (for example with `@babel/cli`) on files that contain JSX, also add `@babel/preset-react` or `@babel/plugin-syntax-jsx`. Without one of them, Babel stops with "Support for the experimental syntax 'jsx' isn't currently enabled" before the compiler runs. Presets run after plugins, so the compiler still runs first. + + ### Vite {/*vite*/} If you use Vite with version 6.0.0 or later of `@vitejs/plugin-react`, you can use the `reactCompilerPreset`: