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!

27 Upvotes

568 comments sorted by

View all comments

Show parent comment

1

u/swyx Aug 02 '18 edited Aug 02 '18

hi, there are a lot of files here. can you please tell me which file to focus on? there doesnt seem to be anything immediately obviously wrong with the app. this is what i see. has the issue been resolved somehow?

in general theres nothing stopping you from returning just the <option>s. if you need to return multiple <options> side by side without a wrapper element you can use React.Fragment.

1

u/ObjectiveLength Aug 02 '18

Thanks for the reply. It's when you click on Load Sample Friends. You'll see that it returns multiple selects.

You'll be looking at AddLineItemForm.js and StatusDropDown.js

Specifically AddLineItemForm.js, I pass in Object.key for state.props.friends into StatusDropDown. And then in StatusDropDown I return Select and Option.