Skip to content

Commit

Permalink
Move saveScrollWidth call to layout effect (#1366)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-f1 authored Jul 21, 2023
1 parent af53f06 commit c6e480e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/desktop-client/src/components/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1060,12 +1060,6 @@ export const Table = forwardRef<TableHandleRef, TableProps>(
list.current?.setRowAnimation(true);
listInitialized.current = true;
}
});

function renderRow({ index, style, key }) {
let item = items[index];
let editing = editingId === item.id;
let selected = isSelected && isSelected(item.id);

if (scrollContainer.current && saveScrollWidth) {
saveScrollWidth(
Expand All @@ -1075,6 +1069,12 @@ export const Table = forwardRef<TableHandleRef, TableProps>(
scrollContainer.current ? scrollContainer.current.clientWidth : 0,
);
}
});

function renderRow({ index, style, key }) {
let item = items[index];
let editing = editingId === item.id;
let selected = isSelected && isSelected(item.id);

let row = renderItem({
item,
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/1366.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [j-f1]
---

Fix React warning in the console

0 comments on commit c6e480e

Please sign in to comment.