Fix react/exhaustive-deps in PayeeTable (#6863)

* Fix react/exhaustive-deps in Modals

* Fix react/exhaustive-deps in PayeeTable

* Add release notes for PR #6863

* Change category and fix dependency management in PayeeTable

Updated category from 'Enhancements' to 'Maintenance' and fixed dependency management in PayeeTable.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Joel Jeremy Marquez
2026-02-05 09:05:23 -08:00
committed by GitHub
parent 2f86bafd1f
commit 2fb98156f6
2 changed files with 12 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
import {
forwardRef,
useCallback,
useEffectEvent,
useLayoutEffect,
useState,
type ComponentProps,
@@ -41,12 +42,15 @@ export const PayeeTable = forwardRef<
const [hovered, setHovered] = useState(null);
const selectedItems = useSelectedItems();
useLayoutEffect(() => {
const onScrollToSelected = useEffectEvent(() => {
const firstSelected = [...selectedItems][0] as string;
if (typeof ref !== 'function') {
ref.current.scrollTo(firstSelected, 'center');
}
// oxlint-disable-next-line react-hooks/exhaustive-deps
});
useLayoutEffect(() => {
onScrollToSelected();
}, []);
const onHover = useCallback(id => {