Rough markup for game container. The container has a few variables to itself in the locked object and the vals object. The former is used in enabling and disabling the submit button in the move form. The latter is tracking the changes in the form inputs so we can send them to the server on submit as our move.
The container contains a header that updates as the game state and phase do, a move form whose number of inputs change with the phase to reflect the functionality of the API, and a board which gets the props for ships, userShots, and opponentShots. The state is fetched and updated on componentDidMount using the id found in the url.
Rough markup for game container. The container has a few variables to itself in the
locked
object and thevals
object. The former is used in enabling and disabling the submit button in the move form. The latter is tracking the changes in the form inputs so we can send them to the server on submit as our move.The container contains a header that updates as the game state and phase do, a move form whose number of inputs change with the phase to reflect the functionality of the API, and a board which gets the props for ships, userShots, and opponentShots. The state is fetched and updated on componentDidMount using the id found in the url.