From 6114b68f780300c2f2f75707f9e1fc5ba4533425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 8 Apr 2026 09:26:32 +0200 Subject: [PATCH] docs: add note about @types/react needed for default JSX mode The default "react" JSX configuration requires @types/react for type checking. Added a note explaining this and pointing to the recommended automatic runtime instead. Closes #2463 Co-Authored-By: Claude Opus 4.6 (1M context) --- runtime/reference/jsx.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/runtime/reference/jsx.md b/runtime/reference/jsx.md index 1aa2f07df..ec6a12844 100644 --- a/runtime/reference/jsx.md +++ b/runtime/reference/jsx.md @@ -29,6 +29,17 @@ options by default: } ``` +:::note + +When using the default `"react"` mode with React, you'll need to add +`@types/react` for type checking to work (e.g., +`"@types/react": "npm:@types/react"` in your `deno.json` imports). Without it +you'll get errors like `JSX element implicitly has type 'any'`. Consider using +the [automatic runtime](#jsx-automatic-runtime-recommended) instead, which is +the recommended approach. + +::: + Using the `"react"` option will convert JSX into the following JavaScript code: ```jsx