gale/app.tsx

23 lines
538 B
TypeScript

import React from "react";
import ReactDOM from "react-dom/client";
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 default function Root()
{
return <div><h1>rooted</h1><App/><Other/></div>
}
ReactDOM.createRoot(document.body).render(<Root/>);