Components & JSX12 / 14
Up next

Typed props interface

// an interface documents the shape of the props
interface GreetingProps {
  name: string;
}

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

export default Greeting;
What you're solving

describe props with a typed interface