r/reactjs • • Aug 01 '18

Beginner's Thread / Easy Question (August 2018)

Hello! It's August! Time for a new Beginner's thread! (July and June here)

Got questions about React or anything else in its ecosystem? Stuck making progress on your app? Ask away! We’re a friendly bunch. No question is too simple. You are guaranteed a response here!

Want Help on Code?

  • Improve your chances by putting a minimal example on to either JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new). Describe what you want it to do, and things you've tried. Don't just post big blocks of code.
  • Pay it forward! Answer questions even if there is already an answer - multiple perspectives can be very helpful to beginners. Also there's no quicker way to learn than being wrong on the Internet.

New to React?

Here are great, free resources!

26 Upvotes

568 comments sorted by

View all comments

Show parent comment

2

u/Awnry_Abe Aug 07 '18

You are right on track. The list rendering component is just a function. List contents and selected item are state of the parent container and are pass as props to the kids.

2

u/therealhenrywinkler Aug 07 '18

Thanks for taking the time to reply.

I actually found that it was helpful to type out the question here. Once I was done writing it I almost didn’t want to submit it.

4

u/Keithin8a Aug 08 '18

That's called rubber ducking, I think it came from a story the wrote on "coding horror" where the guy knew of a developer who had a rubber duck on his desk and basically whenever he was having a problem he would talk to the duck about the problem and come up with the answer, I'm sure there's some science behind why it works, but I just really like the concept of it.