function multiply(a: number, b: number, c?: number): number {
if (typeof c !== 'undefined') {
return a * b * c;
}
return a * b;
}
props.onSaveCourse?.('abc', someDate)
props.onSaveGoal?.('abc')
interface Props {
type: 'goal' | 'course'
onSaveCourse?: (title: string, date: Date) => void
onSaveGoal?: (text: string) => void
}