aboutsummaryrefslogtreecommitdiff
path: root/demos/simple-react/src/index.tsx
blob: 46e0027ef28dee91d21093de453adec563d4f9c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import ReactDOM from "react-dom";
import { Button } from "./components/button";
import { DatePicker } from "antd";

const Base = ({}) => {
  return (
    <main>
      <h1>I am the page</h1>
      <h3 className="bacon">Here is some text</h3>
      <>Fragmen!t</>
      <DatePicker />

      <Button
        label="Do not click."
        onClick={() => alert("I told u not to click!")}
      ></Button>
    </main>
  );
};

function startReact() {
  ReactDOM.render(<Base />, document.querySelector("#reactroot"));
}

globalThis.addEventListener("DOMContentLoaded", () => {
  startReact();
});

export { Base };