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

unable to use vhtml in vite #42

Open
elamandeep opened this issue Jul 1, 2023 · 0 comments
Open

unable to use vhtml in vite #42

elamandeep opened this issue Jul 1, 2023 · 0 comments

Comments

@elamandeep
Copy link

I tried to configure vhtml in vite's vanilla javascript template but I'm unable to implement it. Please guide me on how to configure it.

main.js
------

/** @jsx vhtml */
import { Counter } from "./src/counter";

document.body.innerHTML = (
  <main>
   <Counter/>
  </main>
);
/** @jsx vhtml */

export function Counter() {
  let count = 0;
  return (
    <section>
      <h1>Click button</h1>
      <button onClick={() => count++}>Click me</button>
    </section>
  );
}
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite App</title>
  </head>
  <body>
    <div id="app"></div>
    <script type="module" src="./main.jsx"></script>
  </body>
</html>

image

@elamandeep elamandeep closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2023
@elamandeep elamandeep reopened this Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant