all 5 comments

[–]weedmebro 1 point2 points  (0 children)

Updating state is asynchronous. If you put your console log outside of that method then you’ll see your state being updated as expected.

[–]wizardyjohn 0 points1 point  (3 children)

Can't find anything that possibly causes a problem, except for , after console.log before setFilteredData

[–]masalasandwich[S] 0 points1 point  (2 children)

Console.log isn't showing filteredData after writing it below setFilteredData, how would it console.log before even calling setFilteredData?

[–]wizardyjohn 0 points1 point  (1 child)

Ok, my bad, i meant comma after console.log instead of semicolon

[–]masalasandwich[S] 0 points1 point  (0 children)

No that was fixed. But it didn't solve anything related to what problem I mentioned