This is the component:
const defaultDesc = "welcome to homepage";
export default function Header(Props: {
title:string,
desc?:string
}): JSX.Element {
}
If I don't pass desc in <Header> then I'd like to set defaultDesc value by default. One way to that is to check for empty value of desc and then set it to defaultDesc.
But, is there any other efficient way which avoids multiple checks in case passing many props.
<Header
title="Homepage"
/>