What is the correct chain of actions to use my prop onBackButtonPress?: () => void;
?Right now typescript shows an error for the onPress -
Type '(() => void) | undefined' is not assignable to type '() => void'. Type 'undefined' is not assignable to type '() => void'.
Do i need to type something completely different for the prop in my IconButton and app.tsx Header ?
type HeaderProps = { onBackButtonPress?: () => void;};export function Header({ onBackButtonPress }}: HeaderProps) { return (<View><IconButton onPress={onBackButtonPress} /></View> );}
app.tsx file
<Header onBackButtonPress={() => null} />