Skip to content

Commit 4224c68

Browse files
authored
docs: fix links to react hooks (#11344)
1 parent b014416 commit 4224c68

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

docs/custom-components/overview.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ export default async function MyServerComponent({
276276
277277
But, the Payload Config is [non-serializable](https://react.dev/reference/rsc/use-client#serializable-types) by design. It is full of custom validation functions and more. This means that the Payload Config, in its entirety, cannot be passed directly to Client Components.
278278
279-
For this reason, Payload creates a Client Config and passes it into the Config Provider. This is a serializable version of the Payload Config that can be accessed from any Client Component via the [`useConfig`](../admin/hooks#useconfig) hook:
279+
For this reason, Payload creates a Client Config and passes it into the Config Provider. This is a serializable version of the Payload Config that can be accessed from any Client Component via the [`useConfig`](../admin/react-hooks#useconfig) hook:
280280
281281
```tsx
282282
'use client'
@@ -375,7 +375,7 @@ export function MyClientComponent() {
375375
```
376376
377377
<Banner type="success">
378-
See the [Hooks](../admin/hooks) documentation for a full list of available hooks.
378+
See the [Hooks](../admin/react-hooks) documentation for a full list of available hooks.
379379
</Banner>
380380
381381
### Getting the Current Locale
@@ -422,12 +422,12 @@ function Greeting() {
422422
```
423423

424424
<Banner type="success">
425-
See the [Hooks](../admin/hooks) documentation for a full list of available hooks.
425+
See the [Hooks](../admin/react-hooks) documentation for a full list of available hooks.
426426
</Banner>
427427

428428
### Using Hooks
429429

430-
To make it easier to [build your Custom Components](#building-custom-components), you can use [Payload's built-in React Hooks](../admin/hooks) in any Client Component. For example, you might want to interact with one of Payload's many React Contexts. To do this, you can use one of the many hooks available depending on your needs.
430+
To make it easier to [build your Custom Components](#building-custom-components), you can use [Payload's built-in React Hooks](../admin/react-hooks) in any Client Component. For example, you might want to interact with one of Payload's many React Contexts. To do this, you can use one of the many hooks available depending on your needs.
431431

432432
```tsx
433433
'use client'
@@ -444,7 +444,7 @@ export function MyClientComponent() {
444444
```
445445

446446
<Banner type="success">
447-
See the [Hooks](../admin/hooks) documentation for a full list of available hooks.
447+
See the [Hooks](../admin/react-hooks) documentation for a full list of available hooks.
448448
</Banner>
449449

450450
### Adding Styles

docs/fields/overview.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ In addition to the above props, all Server Components will also receive the foll
658658

659659
When swapping out the `Field` component, you are responsible for sending and receiving the field's `value` from the form itself.
660660

661-
To do so, import the [`useField`](../admin/hooks#usefield) hook from `@payloadcms/ui` and use it to manage the field's value:
661+
To do so, import the [`useField`](../admin/react-hooks#usefield) hook from `@payloadcms/ui` and use it to manage the field's value:
662662

663663
```tsx
664664
'use client'
@@ -677,7 +677,7 @@ export const CustomTextField: React.FC = () => {
677677
```
678678

679679
<Banner type="success">
680-
For a complete list of all available React hooks, see the [Payload React Hooks](../admin/hooks) documentation. For additional help, see [Building Custom Components](../custom-components/overview#building-custom-components).
680+
For a complete list of all available React hooks, see the [Payload React Hooks](../admin/react-hooks) documentation. For additional help, see [Building Custom Components](../custom-components/overview#building-custom-components).
681681
</Banner>
682682

683683
##### TypeScript#field-component-types

docs/hooks/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ There are four main types of Hooks in Payload:
2727

2828
<Banner type="warning">
2929
**Reminder:**
30-
Payload also ships a set of _React_ hooks that you can use in your frontend application. Although they share a common name, these are very different things and should not be confused. [More details](../admin/hooks).
30+
Payload also ships a set of _React_ hooks that you can use in your frontend application. Although they share a common name, these are very different things and should not be confused. [More details](../admin/react-hooks).
3131
</Banner>
3232

3333
## Root Hooks

packages/ui/src/forms/Form/context.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export type RenderedFieldSlots = Map<string, RenderedField>
2424
/**
2525
* Get the state of the form, can be used to submit & validate the form.
2626
*
27-
* @see https://payloadcms.com/docs/admin/hooks#useform
27+
* @see https://payloadcms.com/docs/admin/react-hooks#useform
2828
*/
2929
const useForm = (): Context => useContext(FormContext)
3030
/**
@@ -42,7 +42,7 @@ const useFormInitializing = (): boolean => useContext(InitializingContext)
4242
/**
4343
* Get and set the value of a form field based on a selector
4444
*
45-
* @see https://payloadcms.com/docs/admin/hooks#useformfields
45+
* @see https://payloadcms.com/docs/admin/react-hooks#useformfields
4646
*/
4747
const useFormFields = <Value = unknown>(
4848
selector: (context: FormFieldsContextType) => Value,
@@ -51,7 +51,7 @@ const useFormFields = <Value = unknown>(
5151
/**
5252
* Get the state of all form fields.
5353
*
54-
* @see https://payloadcms.com/docs/admin/hooks#useallformfields
54+
* @see https://payloadcms.com/docs/admin/react-hooks#useallformfields
5555
*/
5656
const useAllFormFields = (): FormFieldsContextType => useFullContext(FormFieldsContext)
5757

packages/ui/src/forms/useField/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
/**
2828
* Get and set the value of a form field.
2929
*
30-
* @see https://payloadcms.com/docs/admin/hooks#usefield
30+
* @see https://payloadcms.com/docs/admin/react-hooks#usefield
3131
*/
3232
export const useField = <TValue,>(options: Options): FieldType<TValue> => {
3333
const { disableFormData = false, hasRows, path, validate } = options

0 commit comments

Comments
 (0)