Iterating and rendering the object details form

Using the Material-UI ExpansionPanel components, we will add the form interface seen previously to create a modifiable array of VR object details for each type of VR object array in the given game.

Inside the ExpansionPanelDetails component, we will iterate through the answerObjects array or the wrongObjects array to render a VRObjectForm component for each VR object.

mern-vrgame/client/game/GameForm.js:

<ExpansionPanel>   <ExpansionPanelSummary expandIcon={<ExpandMoreIcon/>}>      <Typography>VR Objects to collect</Typography>   </ExpansionPanelSummary>   <ExpansionPanelDetails>{      this.state.game.answerObjects.map((item, i) => {        return <div key={i}>                  <VRObjectForm index={i} type={'answerObjects'} vrObject={item} ...

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.