April 2020
Intermediate to advanced
716 pages
18h 55m
English
The GameForm component is used in both the NewGame and EditGame components, and it contains the elements that allow users to enter game details and VR object details for a single game. It may start with a blank game object or load an existing game. To begin the implementation of this component, we will first initialize a blank game object in the component state, as shown in the following code:
mern-vrgame/client/game/GameForm.js:
const [game, setGame] = useState({ name: '', clue: '', world: '', answerObjects: [], wrongObjects: [] })
If the GameForm component receives a gameId prop from the parent component—such as from the EditGame component—then it will use the load game API to retrieve the game's ...
Read now
Unlock full access