Skip to content

Commit e2e1761

Browse files
bartlomiejuclaude
andauthored
docs: add note about @types/react for default JSX mode (#3040)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2ff0019 commit e2e1761

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

runtime/reference/jsx.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@ options by default:
2929
}
3030
```
3131

32+
:::note
33+
34+
When using the default `"react"` mode with React, you'll need to add
35+
`@types/react` for type checking to work (e.g.,
36+
`"@types/react": "npm:@types/react"` in your `deno.json` imports). Without it
37+
you'll get errors like `JSX element implicitly has type 'any'`. Consider using
38+
the [automatic runtime](#jsx-automatic-runtime-recommended) instead, which is
39+
the recommended approach.
40+
41+
:::
42+
3243
Using the `"react"` option will convert JSX into the following JavaScript code:
3344

3445
```jsx

0 commit comments

Comments
 (0)