Hydrogen
info
We have a guide explaining how to integrate Composer Core with Hydrogen: Hydrogen CX Framework Guide
useAtama(fetcher, slug, basePath)
Wraps hydrogens useQuery
to fetch data using the passed fetcher
.
Parameter | Type | Default | Required? | Description |
---|---|---|---|---|
fetcher | Fetcher | - | Yes | An instance of a fetcher |
slug | string | - | Yes | The path to fetch data for |
basePath | string | '' | No | This is useful if your page is running in a sub-directory. |
useAtamaFromRequest(fetcher, request, basePath)
Similar to useAtama
except instead of accepting a specific path it uses the request
object to look for the current url (based on the normalizedUrl
).
Parameter | Type | Default | Required? | Description |
---|---|---|---|---|
fetcher | Fetcher | - | Yes | An instance of a fetcher |
request | HydrogenRequest | - | Yes | The hydrogen request object |
basePath | string | '' | No | This is useful if your page is running in a sub-directory. |