April 2020
Intermediate to advanced
716 pages
18h 55m
English
Each of the items rendered in the list of VR object forms can also be removed from the list by the user. The VRObjectForm component displaying an item will contain a delete option, which will remove the object from the given array.
To implement the remove item functionality for this DELETE button, we will pass a removeObject method as a prop to the VRObjectForm component from the parent GameForm component. This method will allow the array to be updated in the parent component's state when a user clicks DELETE on a specific VRObjectForm. This removeObject method will be defined as shown in the following code:
mern-vrgame/client/game/GameForm.js:
const removeObject = (type, index) => event => { const newGame ...Read now
Unlock full access