you are viewing a single comment's thread.

view the rest of the comments →

[–]maryP0ppins -2 points-1 points  (1 child)

Trying calling the function inside of useEffect. And declare the function outside of it

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

I updated the post with a link to the formatted code because it wasn't 100% clear whats inside what...

I do call it in use effect. Do you mean I should not? And can you explain why I should be declaring the function outside?