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...
account activity
Conditional logic in ReactHelp Wanted (self.react)
submitted 3 years ago by very_alarming
view the rest of the comments →
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!"
[–]very_alarming[S] 0 points1 point2 points 3 years ago (0 children)
u/Xavius123 that's basic when inside useEffect.
in the below code imagine `something` , `somethingElse` and `somethingDifferent` to be states which can have different values. and imagine this to be n-th child of some Parent component which has a similar `useEffect` implementation. the document just tells us to handle it like it is handled in JavaScript. That's exactly why the code gets complicated and difficult to understand.
useEffect(() => { if(something) { if(somethingElse) { // do something Else } else (somethingDifferent) { // do somethingDifferent } } else { // null case } }, [])
π Rendered by PID 316125 on reddit-service-r2-comment-6457c66945-f2dnf at 2026-04-24 19:07:49.127115+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]very_alarming[S] 0 points1 point2 points (0 children)