Closed
Description
Hi,
I was fixing some lint errors and encountered this situation:
const onAccessibilityAction = (event: { nativeEvent: { actionName: any } }) => {
switch (event.nativeEvent.actionName) {
case "delete":
deleteAction();
break;
default:
Alert.alert("Some text);
}
}
const accessibilityActionsList: Array<{ name: string, label: string }> = [{ name: "delete", label: "Delete" }];
<TouchableOpacity
accessibilityActions={accessibilityActionsList}
onAccessibilityAction={onAccessibilityAction}
>
...
</TouchableOpacity>
Here, the has-valid-accessibility-actions rule throws the following errors: accessibilityActions: value must be an Array
and accessibilityActions: has accessibilityActions but onAccessibilityAction is not a function
. However, both of my variables have the correct types. I tried putting the array and the function as is in the JSX (without putting them in a variable) and it worked fine, but I prefer having a simpler/cleaner JSX.
Do you think this is something that can be fixed?
Metadata
Metadata
Assignees
Labels
No labels