---
title: "Discussion on \"Fetching Data in React the Right Way: Axios + TanStack Query\" | Hashnode"
description: "Discussion on \"Fetching Data in React the Right Way: Axios + TanStack Query\". Most React tutorials fetch data with useEffect + useState. It works, until you need caching, retries, refetching, or a clean way to show loading and error states. Then you're hand-rolling a worse vers"
url: "https://hashnode.com/posts/fetching-data-in-react-the-right-way-axios-tanstack-query/6afd08cdf8d7ed05d5452ec0"
---

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

Discussion

# [Fetching Data in React the Right Way: Axios + TanStack Query](https://leeonscoding.hashnode.dev/fetching-data-in-react-the-right-way-axios-tanstack-query?utm_source=hashnode&utm_medium=feed)

Most React tutorials fetch data with useEffect + useState. It works, until you need caching, retries, refetching, or a clean way to show loading and error states. Then you're hand-rolling a worse vers

3h ago · 8 min read · leeonscoding.hashnode.dev  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#axios](https://hashnode.com/tag/axios)
-   [#express](https://hashnode.com/tag/express)
-   [#tanstack-query](https://hashnode.com/tag/tanstack-query)

## Written by

[Asfaq Leeon](https://hashnode.com/@leeonscoding)

@leeonscoding · Dhaka, Bangladesh

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

Senior Software Engineer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
