The recommended way to set default props for a component on the official documentation is the following:
interface Props {
/**
* default 100
*/
size?: number
}
function Avatar({ size = 100 }: Props) {
// ...
}
The problem: the default value is defined twice. Is there a way to define it in one place only?