When I try to filter data with a dropdown it does not update correctly

Viewed 18

enter image description here The function that filters is called handleFilter

Here I leave another image of the drop-down options

enter image description here

1 Answers

u dont need to return useState setter, also u can use function state updater like this,

setTask(currentValue => currentValue.filter((item) => item.priority === 'basico'))
Related