---
title: "Discussion on \"How to Use SWR for Better Data Fetching Approach\" | Hashnode"
description: "Discussion on \"How to Use SWR for Better Data Fetching Approach\". In React, external data is very important to make your project more dynamic. However, when you use useEffect for data fetching, it is generally hard to manage the state, fortunately SWR simplifies this process.\nIntroduction to SWR\nThe first thing I w..."
url: "https://hashnode.com/posts/how-to-use-swr-for-better-data-fetching-approach/646af295403a24631e43497c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Use SWR for Better Data Fetching Approach](https://femincan.dev/how-to-use-swr-for-better-data-fetching-approach?utm_source=hashnode&utm_medium=feed)

In React, external data is very important to make your project more dynamic. However, when you use useEffect for data fetching, it is generally hard to manage the state, fortunately SWR simplifies this process. Introduction to SWR The first thing I w...

May 22, 2023 · 5 min read · femincan.dev  
Updated Oct 26, 2023  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Furkan Emin Can](https://hashnode.com/@femincan)

@femincan · Turkiye

  
[View profile](https://hashnode.com/@femincan)

A front-end developer who loves reading, writing, and calisthenics.

Hello, I'm Furkan Emin Can. I'm a self-taught, passionate front-end developer who enjoys writing TypeScript and strives to become a better developer. In my free time, I love practicing calisthenics and enjoy reading programming blogs that help me improve my skills.

## Responses 3

Markdown supported · ⌘↵ to post

[Ender Bonnet](https://hashnode.com/@enBonnet)

[May 28, 2023](https://hashnode.com/posts/how-to-use-swr-for-better-data-fetching-approach/646af295403a24631e43497c/comment/64733a133f35dda0a9992c7c)

Did you try cancelling the request on the axios side?

[Furkan Emin Can](https://hashnode.com/@femincan)

[May 28, 2023](https://hashnode.com/posts/how-to-use-swr-for-better-data-fetching-approach/646af295403a24631e43497c/comment/64733a133f35dda0a9992c7c#reply-6473563d3f35dda0a9992fa4)

Thanks for the comment Ender.

As I have mentioned in the article, If I didn't use the "Cancelling the button during the ongoing request" approach, I would use AbortController with Axios. But I didn't choose this approach for simplicity.

[Ender Bonnet](https://hashnode.com/@enBonnet)

[May 29, 2023](https://hashnode.com/posts/how-to-use-swr-for-better-data-fetching-approach/646af295403a24631e43497c/comment/64733a133f35dda0a9992c7c#reply-6474c073fff355b232814ecc)

[Furkan Emin Can](https://hashnode.com/@femincan) I get it! Cool article!

[Ákos Kőműves](https://hashnode.com/@akoskm)

[May 25, 2023](https://hashnode.com/posts/how-to-use-swr-for-better-data-fetching-approach/646af295403a24631e43497c/comment/646efa555bd7d54f0c7eaa5e)

Great stuff Furkan! I see the use-case for this in client components, but this isn't necessary anymore with Next.js Server Component [nextjs.org/docs/app/building-your-application/dat…](https://nextjs.org/docs/app/building-your-application/data-fetching/fetching.) You can simply use fetch in the components with await.

[Furkan Emin Can](https://hashnode.com/@femincan)

[May 25, 2023](https://hashnode.com/posts/how-to-use-swr-for-better-data-fetching-approach/646af295403a24631e43497c/comment/646efa555bd7d54f0c7eaa5e#reply-646f3d055bd7d54f0c7eb6f7)

Thanks, Akos!

Today, I am starting a new project with Next.js 13. I will check it out before starting my project.

[Dumebi Okolo](https://hashnode.com/@DumebiO)

[May 25, 2023](https://hashnode.com/posts/how-to-use-swr-for-better-data-fetching-approach/646af295403a24631e43497c/comment/646eb6b3b16e4c4af2911455)

Thank you for sharing. Needed this!

[Furkan Emin Can](https://hashnode.com/@femincan)

[May 25, 2023](https://hashnode.com/posts/how-to-use-swr-for-better-data-fetching-approach/646af295403a24631e43497c/comment/646eb6b3b16e4c4af2911455#reply-646ed78cb16e4c4af29116ab)

You are welcome. It's a pleasure to help.
