---
title: "Discussion on \"Why can't  we have asynchronous callback function \n                                                     in useEffect()\" | Hashnode"
description: "Discussion on \"Why can't  we have asynchronous callback function \n                                                     in useEffect()\". Async calls in javascript can help us in API calls and fetching data from server, but why is it we can't use async calls with useEffect like shown below:\nuseEffect( async () => {\n // api call or data fetch\n}, [])\n\n// It gives an ERROR...\n\nWe can not ..."
url: "https://hashnode.com/posts/useeffect-async/641abc2b711da51231ac5274"
---

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

Discussion

# [Why can't we have asynchronous callback function in useEffect()](https://shubhambhoj.hashnode.dev/useeffect-async?utm_source=hashnode&utm_medium=feed)

Async calls in javascript can help us in API calls and fetching data from server, but why is it we can't use async calls with useEffect like shown below: useEffect( async () => { // api call or data fetch }, \[\]) // It gives an ERROR... We can not ...

Mar 22, 2023 · 1 min read · shubhambhoj.hashnode.dev  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#useeffect](https://hashnode.com/tag/useeffect)
-   [#reacthooks](https://hashnode.com/tag/reacthooks)

## Written by

[Shubham Singh](https://hashnode.com/@ShubhamBhoj)

@ShubhamBhoj · Pilani, Rajasthan

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

Learner

I am a Computer science graduate and passionate frontend web developer and I design and code beautifully simple things, and I love what I do.I like to code things from scratch, and enjoy bringing ideas to life in the browser.Currently on journey of learning Full Stack Javascript Development

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
