Files
excel-download/react_webgame/7. 틱택토/Tr.jsx
2021-03-13 00:32:14 +09:00

21 lines
462 B
JavaScript

import React, {memo, useMemo} from "react";
import Td from "./Td";
const Tr = memo(({ rowData, rowIndex, dispatch }) => {
console.log("tr rendered")
return (
<tr>
{Array(rowData.length)
.fill()
.map((td, i) => (
useMemo(
() => <Td rowIndex={rowIndex} cellIndex={i} dispatch={dispatch} cellData={rowData[i]} >{""}</Td>,
[rowData[i]],
)
))}
</tr>
);
});
export default Tr;