react in cdn
index.html:
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Ariakit</title>
</head>
<body>
<div id="root"></div>
<!-- Babel -->
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<!-- Usage -->
<script type="text/babel" data-type="module">
import * as React from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom";
import { Button } from "https://esm.sh/@ariakit/react";
function App() {
return <Button onClick={() => { alert("clicked") }}>Button</Button>;
}
createRoot(document.getElementById("root")).render(<App />);
</script>
</body>
</html>

浙公网安备 33010602011771号