Skip to content

Commit

Permalink
Address review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrunyon committed Nov 12, 2024
1 parent 231d23a commit dfdb0ce
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/ui/src/js/src/elements/UITable/UITable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ const log = Log.module('@deephaven/js-plugin-ui/UITable');
*/
function useStableArray<T>(array: T[]): T[] {
const stableArray = useRef<T[]>(array);
if (!array.every((v, i) => v === stableArray.current[i])) {
if (
array.length !== stableArray.current.length ||
!array.every((v, i) => v === stableArray.current[i])
) {
stableArray.current = array;
}
return stableArray.current;
Expand Down

0 comments on commit dfdb0ce

Please sign in to comment.