Replies: 2 comments
-
I'm having the same error here |
Beta Was this translation helpful? Give feedback.
0 replies
-
Could you provide a code example of what are you trying to achieve? In SWR you can do conditional data-fetching like this https://swr.vercel.app/docs/conditional-fetching. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I need to do a conditional fetch inside a function that can have many different params.
In the first render I fetch using params coming from useLocation().search (react-router-dom) and the value from a state called "page" because the query is paginated. When the user click a button to load more, I call the function again to do the query with the new page and the same params from useLocation.
I tried to call this directly like a hook, but I couldn't make it work right (it is calling non-stop).
Has anyone been in this situation or can sugest something I can do?
Beta Was this translation helpful? Give feedback.
All reactions