UNPKG

sanity

Version:

Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches

6 lines (4 loc) 189 B
import {useMemo} from 'react' export function usePublishedId<T extends string | undefined>(id: T): T { return useMemo(() => (id ? id.replaceAll('drafts.', '') : undefined) as T, [id]) }