Skip to content

Instantly share code, notes, and snippets.

@jhcheung
Created June 1, 2020 03:11
Show Gist options
  • Save jhcheung/9ce869eaaef2bc67f0f5236719cda654 to your computer and use it in GitHub Desktop.
Save jhcheung/9ce869eaaef2bc67f0f5236719cda654 to your computer and use it in GitHub Desktop.
bg.io local multiplayer
// src/App.js
import React from 'react';
import { Client } from 'boardgame.io/react';
import { Local } from 'boardgame.io/multiplayer';
import { TicTacToe } from './game';
import { TicTacToeBoard } from './board';
const TicTacToeClient = Client({
game: TicTacToe,
board: TicTacToeBoard,
multiplayer: Local(),
});
const App = () => (
<div>
<TicTacToeClient playerID="0" />
<TicTacToeClient playerID="1" />
</div>
);
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment