> For the complete documentation index, see [llms.txt](https://skyslit.gitbook.io/magicjs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://skyslit.gitbook.io/magicjs/api-references/frontend/useaxios.md).

# useAxios()  &#x20;

`useAxios()` simplifies API calls in a React component. It uses underlying Axios client, which is preconfigured to work with MagicJS making it easier to interact with web services.

> Here's an example:

```typescript
import { useAxios } from "@magicjs.dev/frontend"

const client = useAxios()

React.useEffect(() => {
  client.get("https://testApi.com").then((res) => {
    console.log(res)
  })
}, [])
```

[Click here to refer GitHub](https://github.com/skyslit/magicjs.dev/blob/main/packages/frontend/src/index.tsx#L164).
