Tic Tac Toe in ReactJS

03 Jan 2023 / Oscar F
tic tac toe game and reactjs logo

Create the game

Install NodeJS and npm

sudo apt install nodejs npm

Create React app

npx create-react-app tic-tac-toe
cd tic-tac-toe
npm start

Update index.js

const root = ReactDOM.createRoot(document.getElementById("tic-tac-toe"));
root.render(<Game />);

Build for production

npm run build

Add the game to your site

<link rel="stylesheet" type="text/css" href="/documents/7/tic-tac-toe.css">
<div id="tic-tac-toe"></div>
<script src="/documents/8/tic-tac-toe.js" async=""></script>

Play the game