allTheFrontendBackendPatterns
Viewing readonly version: 23View latest version
Script
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
function App() {
const [count, setCount] = useState(0);
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
Click me
</button>
</div>
);
}
createRoot(document.getElementById("root")).render(<App />);