21 lines
370 B
JavaScript
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 />
|
|
</>
|
|
);
|