prop types in typescript syntax code example
Example 1: prop-types
npm install --save prop-types
Example 2: ts react props type
type Props = {
size: string;
}
const Component = ({ size = 'medium' }: Props) => (
<div className={cn('spinner', size)} />
);