Answers for "react typescript optional props"

1

react typescript optional props

type HeaderProps = {
  title?: string
};

const Header: FC<HeaderProps> = ({ title = 'Default Title' }) => {

  return (
     <img src="https://i.pinimg.com/originals/e5/4c/b4/e54cb468c3cf376d1b75014e7186236a.jpg" />
  );
}
Posted by: Guest on May-04-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language