diff --git a/src/components/Cell.jsx b/src/components/Cell.jsx index 68b6475..bead064 100644 --- a/src/components/Cell.jsx +++ b/src/components/Cell.jsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useCallback } from "react"; import PropTypes from "prop-types"; /** @@ -9,6 +9,10 @@ import PropTypes from "prop-types"; * @returns A JSX button object representing a Cell. */ function Cell({ cellStatus, cellValue, onClick }) { + const handleClick = useCallback(() => { + onClick(cellValue, cellStatus(cellValue)); + }, [cellValue, cellStatus, onClick]); + return ( ); }