Skip to main content

useCmsDocument

A published CMS document by slug, in options.locale or else the runtime's language. Waits while slug is empty; a new CMS locale reads it again.

Kind: React hook
Package: @ovok/core

Import​

import { useCmsDocument } from '@ovok/core';

TypeScript signatures​

<T extends object = OvokCmsDocument>(collection: string, slug: string | undefined, options?: OvokCmsOptions): OvokRequestState<T>
ParameterTypeDetails
collectionstring—
slugstring | undefined—
optionsOvokCmsOptions—

Returns: OvokRequestState<T>.

Learn the workflow​

Continue with React for the workflow context and examples.

Source​

View the declaration in the SDK source.