Skip to content

Commit d896f9a

Browse files
committed
Move stega util exports out of custom client hook
1 parent 15e7bbd commit d896f9a

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ export * from './useVideoPlayer/index.js';
1010

1111
export * from './ContentLink/index.js';
1212
export * from './useContentLink/index.js';
13+
14+
// Re-export types and utilities from @datocms/content-link for convenience
15+
// Do NOT put these in a 'use client' component or custom hook or they won't run in RSCs correctly
16+
export { decodeStega, revealStega, stripStega } from '@datocms/content-link';
17+
export type { Controller } from '@datocms/content-link';

src/useContentLink/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
'use client';
22

33
import { type Controller, createController } from '@datocms/content-link';
4-
import { useCallback, useEffect, useRef } from 'react';
5-
6-
// Re-export types and utilities from @datocms/content-link for convenience
7-
export { decodeStega, revealStega, stripStega } from '@datocms/content-link';
8-
export type { Controller } from '@datocms/content-link';
4+
import { type RefObject, useCallback, useEffect, useRef } from 'react';
95

106
export type UseContentLinkOptions = {
117
/**
@@ -26,7 +22,7 @@ export type UseContentLinkOptions = {
2622
/** Callback when Web Previews plugin requests navigation */
2723
onNavigateTo?: (path: string) => void;
2824
/** Ref to limit scanning to this root instead of document */
29-
root?: React.RefObject<HTMLElement>;
25+
root?: RefObject<HTMLElement>;
3026
/**
3127
* Hue (0–359) of the overlay accent color.
3228
* @default 17 (orange)

0 commit comments

Comments
 (0)