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

View File

@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [joel-jeremy]
---
Fix react-hooks/exhaustive-deps in in PayeeTable