Replies: 1 comment 1 reply
-
You could abstract that hook definition in a custom hook that takes the prefix as argument: export function useDashboardDateFilter(prefix: string) {
return useQueryState(`${prefix}-dateFilter`, parseAsDateFilter)
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Let's say i have a queryState named dateFilter and a dashboard. Each graph in the dashboard needs it own date filter. I have to declare manually queryState for each one, and use unique keys to avoid conflict. Is there any way to create something like a jotai atom family to avoid to do repetitive declarations?
Beta Was this translation helpful? Give feedback.
All reactions