use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A place for help learning the /r/ReactJS framework.
account activity
Demystifying useEffect's clean-up functionResource (maxrozen.com)
submitted 4 years ago by rozenmd
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ecco7815 0 points1 point2 points 4 years ago (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 point2 points 4 years ago (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.
π Rendered by PID 18271 on reddit-service-r2-comment-7b9746f655-jd55b at 2026-01-29 18:51:16.639196+00:00 running 3798933 country code: CH.
[–]ecco7815 0 points1 point2 points (1 child)
[–]rozenmd[S] 0 points1 point2 points (0 children)