Skip to content

Commit 0b53334

Browse files
committed
chore: move keys to cache
1 parent c3a21ff commit 0b53334

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Body/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ function Body<RecordType>(props: BodyProps<RecordType>) {
4949
getRowKey,
5050
);
5151

52+
const rowKeys = React.useMemo(() => flattenData.map(item => item.rowKey), [flattenData]);
53+
5254
// =================== Performance ====================
5355
const perfRef = React.useRef<PerfRecord>({
5456
renderWithProps: false,
@@ -62,7 +64,6 @@ function Body<RecordType>(props: BodyProps<RecordType>) {
6264

6365
let rows: React.ReactNode;
6466
if (data.length) {
65-
const rowKeys = flattenData.map(item => item.rowKey);
6667
rows = flattenData.map((item, idx) => {
6768
const { record, indent, index: renderIndex, rowKey } = item;
6869

0 commit comments

Comments
 (0)