Typing Props

type GreetProps = {
  name: string
}

export const Greet = (props: GreetProps) => {
  return (
    <div>
      <h2>Welcome {props.name}</h2>
    </div>
  )
}

Pro tip: Use types for building applications and interfaces when building libraries, however there’s hardly any difference using one over the other.

Typing Props