Skip to content

Commit ad61a08

Browse files
authored
Fix affinity test flake due to missing column memoization (#2816)
fix affinity test flake due to missing column memoization
1 parent 239e34b commit ad61a08

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/pages/project/instances/AntiAffinityCard.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,23 +122,23 @@ export function AntiAffinityCard() {
122122
[instance, project, removeMember]
123123
)
124124

125-
const antiAffinityCols = useColsWithActions(
126-
[
125+
// has to be memoized to avoid extra renders on instance poll closing the menu
126+
const cols = useMemo(
127+
() => [
127128
colHelper.accessor('name', {
128129
cell: makeLinkCell((antiAffinityGroup) =>
129130
pb.antiAffinityGroup({ project, antiAffinityGroup })
130131
),
131132
}),
132133
...staticCols,
133134
],
134-
makeActions,
135-
'Copy group ID'
135+
[project]
136136
)
137137

138138
const [isModalOpen, setIsModalOpen] = useState(false)
139139

140140
const antiAffinityTable = useReactTable({
141-
columns: antiAffinityCols,
141+
columns: useColsWithActions(cols, makeActions, 'Copy group ID'),
142142
data: memberGroups.items,
143143
getCoreRowModel: getCoreRowModel(),
144144
})

0 commit comments

Comments
 (0)