Props2 / 12
Up next

Typed props interface

interface UserProps {
  name: string;
  age: number;
}

function UserRow(props: UserProps) {
  return <li>{props.name} ({props.age})</li>;
}

export default UserRow;
What you're solving

type a component's props with an interface