Is data fetching using SWR necessary? #89
-
Can you please explain the use of Without swr
According to Next.js: Behind the scenes, React and Next.js will cache and dedupe requests to avoid the same data being fetched more than once. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@devevignesh Hi, Sure let me explain. For couple of reasons i choose SWR library and doing most of my GET requests in client side.
I think i can move some of API from client side to server side if needed. But i chose not to do it. If you think you can make this better, send a PR 🤓. I know NextJS says we can make requests in server side and move it only if needed in client side, but its not a hard fast rule. Ideally where to make API call depends on the application. In my case, i want to make API calls on the select dropdown change + date picker in overview. Hope this answers your questions. |
Beta Was this translation helpful? Give feedback.
@devevignesh Hi, Sure let me explain. For couple of reasons i choose SWR library and doing most of my GET requests in client side.
I think i can move some of API from …