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