Skip to content

Commit

Permalink
adjusts jsdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsfletch committed Dec 2, 2024
1 parent 4f39762 commit 4bf4181
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/ui/src/providers/Params/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Context = createContext<IParamsContext>({} as IParamsContext)

/**
* @deprecated
* This provider is deprecated and will be removed in the next major release. Instead, use the `useParams` hook from `next/navigation` instead. See https://github.com/payloadcms/payload/pull/9576.
* The ParamsProvider is deprecated and will be removed in the next major release. Instead, use the `useParams` hook from `next/navigation` directly. See https://github.com/payloadcms/payload/pull/9581.
* @example
* ```tsx
* import { useParams } from 'next/navigation'
Expand All @@ -23,7 +23,7 @@ export const ParamsProvider: React.FC<{ children?: React.ReactNode }> = ({ child

/**
* @deprecated
* This provider is deprecated and will be removed in the next major release. Instead, use the `useParams` hook from `next/navigation` instead. See https://github.com/payloadcms/payload/pull/9576.
* The `useParams` hook is deprecated and will be removed in the next major release. Instead, use the `useParams` hook from `next/navigation` directly. See https://github.com/payloadcms/payload/pull/9581.
* @example
* ```tsx
* import { useParams } from 'next/navigation'
Expand Down
11 changes: 8 additions & 3 deletions packages/ui/src/providers/SearchParams/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Context = createContext(initialContext)

/**
* @deprecated
* This provider is deprecated and will be removed in the next major release. Instead, use the `useSearchParams` hook from `next/navigation` instead. See https://github.com/payloadcms/payload/pull/9576.
* The SearchParamsProvider is deprecated and will be removed in the next major release. Instead, use the `useSearchParams` hook from `next/navigation` directly. See https://github.com/payloadcms/payload/pull/9581.
* @example
* ```tsx
* import { useSearchParams } from 'next/navigation'
Expand Down Expand Up @@ -53,10 +53,15 @@ export const SearchParamsProvider: React.FC<{ children?: React.ReactNode }> = ({

/**
* @deprecated
* This provider is deprecated and will be removed in the next major release. Instead, use the `useParams` hook from `next/navigation` instead. See https://github.com/payloadcms/payload/pull/9576.
* The `useSearchParams` hook is deprecated and will be removed in the next major release. Instead, use the `useSearchParams` hook from `next/navigation` directly. See https://github.com/payloadcms/payload/pull/9581.
* @example
* ```tsx
* import { useParams } from 'next/navigation'
* import { useSearchParams } from 'next/navigation'
* ```
* If you need to parse the `where` query, you can do so with the `parseSearchParams` utility.
* ```tsx
* import { parseSearchParams } from '@payloadcms/ui'
* const parsedSearchParams = parseSearchParams(searchParams)
* ```
*/
export const useSearchParams = (): SearchParamsContext => useContext(Context)

0 comments on commit 4bf4181

Please sign in to comment.