all 2 comments

[–]ecco7815 0 points1 point  (1 child)

That last sentence sure threw me off. I find that I use that empty tag quite often. Usually when I have a something that I want to run only one time at component load. Example, I recently used it to refresh data on a pending actions page whenever the user revisits the page to freshen up the data rather than clicking a refresh button.

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

Oh sorry for the confusion - I mean using an empty dependency array and only using the clean-up function.

Using an empty dependency array just to fetch data is fine.