Skip to content

Allow jsx in <script> tag #415

@zanminkian

Description

@zanminkian

Description

<!doctype html>
<html>
  <head>
    <title>react-boilerplate</title>
    <script type="module">
      import { createElement } from "react";
      import { createRoot } from "react-dom/client";

      createRoot(document.getElementById("root")).render(createElement('h1', null, 'hello world'));
    </script>
  </head>
  <body>
    <noscript>You need to enable JavaScript to run this app.</noscript>
    <div id="root"></div>
  </body>
</html>

Code above will work well if we run vite build. But it would be better if we support jsx in <script> tag. Just like createRoot(document.getElementById("root")).render(<h1>hello world</h1>);

Suggested solution

Support jsx in <script> tag.

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions