ReactJsReact with TypeScript

TypeScript adds static type checking to React, making your code more robust and easier to maintain. You define types for props, state, and hooks.

import React from 'react';

type GreetingProps = {
  name: string;
};

function Greeting({ name }: GreetingProps) {
  return <h1>Hello, {name}!</h1>;
}

export default Greeting;