const layoutAreaStyle = { width: 500, height: 400, overflow: 'hidden', }; function App() { const boxSize = 20; const boxStyle = { width: boxSize, height: boxSize, boxShadow: 'inset -1px -1px #0275b8', opacity: 0.4 }; const getBoxCount = () => { const countX = Math.floor(layoutAreaStyle.width / boxSize) + 1; const countY = Math.floor(layoutAreaStyle.height / boxSize) + 1; return countX * countY; };