r/reactjs • • Jun 03 '18

Beginner's Thread / Easy Question (June 2018)

Hello! just helping out /u/acemarke to post a beginner's thread for June! we had over 270 comments in last month's thread! If you didn't get a response there, please ask again here! You are guaranteed a response here!

Soo... 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.

The Reactiflux chat channels on Discord are another great place to ask for help as well.

Pre-empting the most common question: how to get started learning react?

You might want to look through /u/acemarke's suggested resources for learning React and his React/Redux links list. Also check out http://kcd.im/beginner-react.

32 Upvotes

537 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Jun 06 '18

Thank you, the code example resolved my confusion. I was still trying to key=weakKey() in my props and just gave up lol. 😆 (bigger fish to fry atm)

Is this a common pattern among React developers? Are their competing options for setting keys in scenarios where no keys exist and index wouldn’t be suitable?

3

u/acemarke Jun 06 '18

I'm not entirely sure how others might handle this situation. I would guess that very few people know about weak-key's existence, which is one reason why I try to mention it :)

1

u/[deleted] Jun 06 '18

Yeah, not too many downloads on npm. But a solid module! Maybe it will catch on.

1

u/Ls777 Jun 07 '18

I usually just add id's to the data if it doesn't have one (using uuids). If you are dealing with a dynamic list it can help in other cases for each item to have a unique ID anyways imo.

Thanks for this library tho, it looks like a better solution lol