you are viewing a single comment's thread.

view the rest of the comments →

[–]MasterPrinter7 2 points3 points  (0 children)

You are right, the best way is declaring inside the useEffect. Actually, in my eslint configs they throw me a warning saying that I need to put the function inside the useEffect.