May 2018
Intermediate to advanced
470 pages
13h 54m
English
The NewGame component uses the GameForm component to render the form elements the user will fill out to create a new game:

The GameForm contains all the form fields, and it takes the onSubmit method that should be executed when the user submits the form, as a prop from the NewGame component along with any server-returned error messages.
mern-vrgame/client/game/NewGame.js:
<GameForm onSubmit={this.clickSubmit} errorMsg={this.state.error}/>
The clickSubmit method uses the create fetch method from api-game.js to make a POST request to the create API with the game form data and user details.
mern-vrgame/client/game/NewGame.js ...
Read now
Unlock full access