Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/hooks/useAnimatedHighlightStyle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ export default function useAnimatedHighlightStyle({
return;
}
setStartHighlight(true);
}, [shouldHighlight, startHighlight]);
// We only need to add shouldHighlight as a dependency and adding startHighlight as deps will cause a loop because
// if shouldHighlight stays at true the above early return will not be executed and this useEffect will be run
// as long as shouldHighlight is true as we set startHighlight to false in the below useEffect.
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
}, [shouldHighlight]);

React.useEffect(() => {
if (!startHighlight || !didScreenTransitionEnd) {
Expand Down