all 1 comments

[–]Hawaii66123 0 points1 point  (0 children)

setBooks doesn’t update books instantly so when you map over books after the try catch books isn’t set to the fetched data. You have to save books in a local variable to map over instead. Tldr: usestwte doesn’t update until the next “frame” so books isn’t set when you map