EditGame component

Just like in the NewGame component, the EditGame component will also use the GameForm component to render the form elements, but this time the fields will show the current values of the game fields, and users will be able to update these values:

In the case of the EditGame component, GameForm will take the given game's ID as a prop so it can fetch the game details, in addition to the onSubmit method and server-generated error message, if any.

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

<GameForm gameId={this.match.params.gameId} onSubmit={this.clickSubmit} errorMsg={this.state.error}/>

The clickSubmit method for the edit form will ...

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.