Premium

Tic-Tac-Toe (Component State + Winner Detection)

By FrontendAtlas Editorial · Updated Jan 30, 2026

Challenge summary

Build Tic-Tac-Toe with React state: a 9-cell board, alternating turns, win/draw detection, and a reset button. Prevent overwriting a filled cell and stop play once the game is over.

What you'll practice

  • Render the Tic-Tac-Toe UI as the main component.
  • Render a 3×3 board (9 cells).
  • Clicking an empty cell places the current player's mark (only if the game is not over).
  • Detect a draw when the board is full and there is no winner.
  • Show status text (next player / winner / draw).

What Premium unlocks

Premium unlocks the runnable workspace, behavioral checks, implementation walkthrough, and edge-case discussion. It also runs as an Interview Pressure Mode, in rounds that add requirements the way an interviewer does.

Free related practice

Upgrade to FrontendAtlas Premium to unlock this challenge. Already upgraded? Sign in to continue.

Premium is $24 a month or $99 a year, less in many countries.