diff --git a/src/index.ts b/src/index.ts index 8ee53e7..cab3c4e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,3 +10,8 @@ export * from './useVideoPlayer/index.js'; export * from './ContentLink/index.js'; export * from './useContentLink/index.js'; + +// Re-export types and utilities from @datocms/content-link for convenience +// Do NOT put these in a 'use client' component or custom hook or they won't run in RSCs correctly +export { decodeStega, revealStega, stripStega } from '@datocms/content-link'; +export type { Controller } from '@datocms/content-link'; diff --git a/src/useContentLink/index.ts b/src/useContentLink/index.ts index 3cc40ee..4477654 100644 --- a/src/useContentLink/index.ts +++ b/src/useContentLink/index.ts @@ -1,11 +1,7 @@ 'use client'; import { type Controller, createController } from '@datocms/content-link'; -import { useCallback, useEffect, useRef } from 'react'; - -// Re-export types and utilities from @datocms/content-link for convenience -export { decodeStega, revealStega, stripStega } from '@datocms/content-link'; -export type { Controller } from '@datocms/content-link'; +import { type RefObject, useCallback, useEffect, useRef } from 'react'; export type UseContentLinkOptions = { /** @@ -26,7 +22,7 @@ export type UseContentLinkOptions = { /** Callback when Web Previews plugin requests navigation */ onNavigateTo?: (path: string) => void; /** Ref to limit scanning to this root instead of document */ - root?: React.RefObject; + root?: RefObject; /** * Hue (0–359) of the overlay accent color. * @default 17 (orange)