Handle input

All the input changes will be handled by the handleChange method that will update the game values in state with the user input.

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

handleChange = name => event => {    const newGame = this.state.game     newGame[name] = event.target.value     this.setState({game: newGame}) }

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.