gale/app.tsx

25 lines
532 B
TypeScript

import ReactDOM from "react-dom/client";
import React from "react";
export function App(){
const [countGet, countSet] = React.useState(2);
return <>
<p style={{padding:"2rem", background:"red", color:"white"}}>test paragraph</p>
<button onClick={()=>{countSet(countGet+1)}}>{countGet}</button>
</>
}
export const Other =()=>{
return <p>other app component</p>
}
export function Root()
{
return <div><h1>rooted</h1><App/><Other/></div>
}
ReactDOM.createRoot(document.body).render(<Root/>);