when I click on icon with touchableopacity in react native first time its not working but 2nd time it works
<View>
<TextInput
style={styles.input}
placeholder="Add new task"
value={task}
onChangeText={setTask}
/>
<MyPressable
style={styles.button}
android_ripple={{ color: 'powderblue' }}
touchOpacity={0.6}
onPress={handleAddTask}
>
<Text style={styles.buttonText}>Add Task</Text>
</MyPressable>
</View>
<TouchableOpacity onPressIn={() => deleteTask(index)}>
<Icon name="trash" size={20} color="black" />
</TouchableOpacity>
I just want it work as I click on Icon
change
onPressIn
toonPress
in props TouchableOpacity