-
A hook to handle fetching data from an API, along with loading and error states. This makes it easier to handle API calls in React components.
Parameters:
```
url: string – The API endpoint to fetch …
-
### Environment
------------------------------
- Operating System: Darwin
- Node Version: v20.15.1
- Nuxt Version: 3.14.1592
- CLI Version: 3.15.0
- Nitro Version: 2.10.4
- Package Ma…
-
> [!NOTE]
> I have since noticed that this is an issue for many of the types provided, not just default. For example, following the docs does not allow your custom wrapper to use a function for the UR…
-
### Describe the feature
```ts
const id = ref()
useFetch('/api/test', {
query: {
id
},
ready: () => !!id.value
})
```
```ts
interface Options {
/** default `() => true` */
ready: () =>…
-
hi @pi0, @danielroe
is it possible to pass the "key" on calling refresh/execute or making the key computed in options?
In my case i got a computed header with Authorization and custom key
`c…
-
Hello, I have the newest Nuxt (v3.14.159) and nuxt-security (v2.0.0) packages .
When I call `useFetch` to a server route, in a page, where SWR is enabled, I get a 401 because of the http basic auth.…
-
**Describe the bug**
I believe this is unexpected behaviour, however maybe it's intentional and just a bit confusing.
Given a simple use of `useFetch`:
```tsx
function MyComponent() {
const …
-
### 🐛 The bug
Hi, I found this specific bug that occurs using layouts and having `pageTransition` and `layoutTransition` enabled in nuxt config. Then, you navigate between layouts and the last page h…
-
At the moment the documentation uses useLazyFetch (and useFetch with lazy option) without await (https://nuxt.com/docs/getting-started/data-fetching#lazy) as well as with await (https://nuxt.com/docs/…
-
### Describe the feature
Give more control over caching with fetching strategies/policies:
```js
useFetch('/api/foo', {
fetchPolicy: 'cache-first',
})
```
- `cache-first`: if present in c…