import React, { Component } from 'react'; import '../styles/styles.css'; import '../styles/bootstrap.css'; import Field from '../components/Field.js'; import Ready from '../components/Ready.js'; import request, {host} from '../scripts/requests.js'; class NewGame extends Component { getToken() { return this.queryParams.get('playerToken'); } getGameId() { return this.queryParams.get('gameId'); } constructor(props) { super(props); this.state = { ok: false } this.queryParams = new URLSearchParams(window.location.search); } update() { const line = this.field.getLine(); request("check_field_correct", {field: line}, (response) => { this.setState({ok: response.correct}); if (response.correct) { this.ready.setState({ text: "Я готов", disabled: false }) } else { this.ready.setState({ text: "Расставь корабли чтобы активировать", disabled: true }) } this.ready.setState({ok: this.state.ok}); }); } render() { return (

Расставь корабли

{/*

Player1

Player2

*/}

Player1

Ссылка для подключения