Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Channels UI polish #4820

Merged
merged 3 commits into from
Nov 14, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Manage useEffect deps properly
ukutaht committed Nov 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit ed4ebee1c09783dfa2228961fdd1dba8e2c01935
2 changes: 1 addition & 1 deletion assets/js/dashboard/hooks/use-previous.ts
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ function usePrevious<T>(value: T): T | undefined {
useEffect(() => {
// Update the ref with the current value after render
ref.current = value;
});
}, [value]);

// Return the previous value
return ref.current;
2 changes: 1 addition & 1 deletion assets/js/dashboard/stats/sources/source-list.js
Original file line number Diff line number Diff line change
@@ -180,7 +180,7 @@
if (currentTab == 'all' && isRemovingFilter('channel')) {
setTab('channels')()
}
}, [query])
}, [query, currentTab])

Check warning on line 183 in assets/js/dashboard/stats/sources/source-list.js

GitHub Actions / Build and test

React Hook useEffect has missing dependencies: 'previousQuery' and 'setTab'. Either include them or remove the dependency array

function setTab(tab) {
return () => {