Skip to content

Commit

Permalink
feat(memoize-table-columns): memoize device list table columns
Browse files Browse the repository at this point in the history
  • Loading branch information
TimBroddin authored and nurikk committed Dec 10, 2023
1 parent 57fad52 commit ec9bf9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/zigbee/DevicesTable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useMemo } from 'react';
import style from './style.module.css';
import { genDeviceDetailsLink, lastSeen, toHex } from '../../utils';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -72,7 +72,7 @@ export function DevicesTable(
},
]
: [];
const columns = [
const columns = useMemo(() => [
{
id: 'pic',
Header: t('pic'),
Expand Down Expand Up @@ -182,7 +182,7 @@ export function DevicesTable(
},
disableSortBy: true,
},
];
], []);

return (
<div className="card">
Expand Down

0 comments on commit ec9bf9e

Please sign in to comment.