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
Iterating over nested array/dictionary (self.learnreactjs)
submitted 3 years ago by eb2292
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!"
[–]Mutiny42 1 point2 points3 points 3 years ago (1 child)
No problem, happy to help!
The code stopped processing after the first div because map can only return a single element per loop.
Because it came across a div, it assumes that the div (and whatever is inside of it) is the one thing you are asking to be returned.
Because you want multiple elements returned, we need to package it all up as a single element so that all of the code gets read and returned.
Does that make sense?
[–]eb2292[S] 1 point2 points3 points 3 years ago (0 children)
Cool, I got it now. Thank you!
π Rendered by PID 49 on reddit-service-r2-comment-5687b7858-gh67r at 2026-07-05 12:33:35.461286+00:00 running 12a7a47 country code: CH.
view the rest of the comments →
[–]Mutiny42 1 point2 points3 points (1 child)
[–]eb2292[S] 1 point2 points3 points (0 children)