Skip to content

Commit

Permalink
useCallback deps
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Jun 30, 2023
1 parent eb95cf9 commit d4aa225
Showing 1 changed file with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1278,15 +1278,21 @@ function TransactionTableInner({
const containerRef = createRef();
const isAddingPrev = usePrevious(props.isAdding);

let onNavigateToTransferAccount = useCallback(accountId => {
props.onCloseAddTransaction();
props.onNavigateToTransferAccount(accountId);
});
let onNavigateToTransferAccount = useCallback(
accountId => {
props.onCloseAddTransaction();
props.onNavigateToTransferAccount(accountId);
},
[props.onCloseAddTransaction, props.onNavigateToTransferAccount],
);

let onNavigateToSchedule = useCallback(scheduleId => {
props.onCloseAddTransaction();
props.onNavigateToSchedule(scheduleId);
});
let onNavigateToSchedule = useCallback(
scheduleId => {
props.onCloseAddTransaction();
props.onNavigateToSchedule(scheduleId);
},
[props.onCloseAddTransaction, props.onNavigateToSchedule],
);

useEffect(() => {
if (!isAddingPrev && props.isAdding) {
Expand Down

0 comments on commit d4aa225

Please sign in to comment.