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 (once in the interface comment and once in the function signature). Is there a way to define it in one place only?
1