Props10 / 12
Up next

Spreading props

type InputProps = React.InputHTMLAttributes<HTMLInputElement>;

// spread forwards every standard input attribute
function TextField(props: InputProps) {
  return <input type="text" {...props} />;
}

export default TextField;
What you're solving

forward a props object with the spread operator