Aug 10, 2024
node -v
).npm create vite@latest
App
component.Message.tsx
:
const Message = () => {
return <h1>Hello World</h1>;
};
export default Message;
App.tsx
.const name = "Mosh";
return <h1>Hello {name}</h1>;
onClick
prop to handle click events.<li onClick={() => console.log(item)}>{item}</li>
<ListGroup items={cities} heading="Cities" />
{items.length === 0 ? <p>No items found</p> : <ItemList />}
interface ListGroupProps {
items: string[];
heading: string;
}