Build a React app that renders a chessboard. When the user hovers over a square, it should highlight all legal Queen moves from that position.
Render a standard 8×8 chessboard (total 64 cells).
When the user hovers over any square:
Highlight all valid Queen moves:
The hovered square must be visually distinct (e.g. hovered style).
hovered
When the mouse leaves the square:
On initial load:
Each square must:
data-testid="cell-{row}-{col}"
role="gridcell"
role="grid"
(0,0)
(7,7)
Solve Similar questions 🔥
Want to upskill? Explore our courses!
Namaste AI
Learn to build modern AI applications with real-world projects.
Namaste DSA
Master DSA from scratch with numerous problems, and expert guidance.
Namaste React
Wanna dive deep into React and become Frontend Expert? Learn with me now!
Namaste Frontend System Design
The most comprehensive and detailed course for frontend system design.
Namaste Node.js
Wanna dive deep into Node.js? Enroll into `Namaste Node.js` now!