So übergeben Sie die Funktion als optionale Requisiten im TypeScript -Typ
interface Props {
type: 'goal' | 'course'
onSaveCourse?: (title: string, date: Date) => void
onSaveGoal?: (text: string) => void
}
Lucifar