mirror of
https://github.com/plausible/analytics.git
synced 2024-11-22 02:27:57 +03:00
Manage useEffect deps properly
This commit is contained in:
parent
ebb5a46872
commit
ed4ebee1c0
@ -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;
|
||||
|
@ -180,7 +180,7 @@ export default function SourceList() {
|
||||
if (currentTab == 'all' && isRemovingFilter('channel')) {
|
||||
setTab('channels')()
|
||||
}
|
||||
}, [query])
|
||||
}, [query, currentTab])
|
||||
|
||||
function setTab(tab) {
|
||||
return () => {
|
||||
|
Loading…
Reference in New Issue
Block a user