Why I get this error message:
Type '(message?: string | undefined) => void' is not assignable to type '(event: GestureResponderEvent) => void'. Types of parameters 'message' and 'event' are incompatible. Type 'GestureResponderEvent' is not assignable to type 'string'.ts(2322)
when I use the function like this:
<Button onPress={handleToggleModalMessage} style={[ButtonStyles.full, s.noneBorderTop]}><Text style={s.errorBtn}>Ok!</Text></Button>
But when I use this above function in this way then I dont get an ts error:
<Button onPress={() => handleToggleModalMessage()} style={[ButtonStyles.full, s.noneBorderTop]}><Text style={s.errorBtn}>Ok!</Text></Button>
can anyone explain me why?