Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow jsx in <script> tag #415

Open
4 tasks done
zanminkian opened this issue Mar 3, 2025 · 0 comments
Open
4 tasks done

Allow jsx in <script> tag #415

zanminkian opened this issue Mar 3, 2025 · 0 comments

Comments

@zanminkian
Copy link

zanminkian commented Mar 3, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant