Delete object button

The VRObjectForm will contain a Delete button that will execute the removeObject method received in the GameForm props form:

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

<Button onClick={this.props.removeObject(this.props.type, this.props.index)}>     <Icon>cancel</Icon> Delete</Button>

The removeObject method will take the value of the object array type and the array index position to remove the given object from the relevant VR objects array in the GameForm state.

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.