web-dev-presentation/index.jsx
2023-11-07 21:25:24 -06:00

21 lines
370 B
JavaScript

import React, { renderDom, useState } from "./react";
/** @jsx React.createElement */
function App() {
const [value, setValue] = useState();
return (
<>
<p>Counter value: {value}</p>
<button onClick={() => setValue((i) => i + 1)}>Increment</button>
</>
);
}
renderDom(
document.getElementById("app"),
<>
<App />
<App />
</>
);