-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
📋 Explain your issue
I'm confused trying to understand the extent to which Astro, without the React (or another framework) integration, supports JSX/TSX syntax.
Support for .jsx and .tsx files is currently mentioned in the docs here and here (both on the guides/imports page)
It is noted:
While Astro understands JSX syntax out-of-the-box, you will need to include a framework integration to properly render frameworks like React, Preact and Solid.
Could the extent to which the syntax/filetype is supported be explained a little more explicitly? I can see types for JSXTransformConfig and JSXTransformFn in the Astro source, but writing even the simplest JSX, such as const testJsx = () => <p>Hello, world!</p> leads to a build error like Cannot find module 'react/jsx-dev-runtime' imported from <testJsx.jsx>
In the docs-given example:
import { MyComponent } from './MyComponent.jsx';What JSX could be declared/implemented/returned by MyComponent that would not require a framework integration to be installed?
It's late, so I appreciate I may not be firing on all cylinders, but I do wonder if this clarification may be a beneficial amendment to the docs. I appreciate your time; thanks!