Props6 / 12
Up next

Readonly props

interface PriceProps {
  // Readonly signals props must not be mutated
  readonly amount: number;
  readonly currency: string;
}

function Price({ amount, currency }: PriceProps) {
  return <span>{amount} {currency}</span>;
}

export default Price;
What you're solving

props are read-only inside a component