Skip to content

docs: add getDataByPath to useForm table#12098

Merged
paulpopus merged 1 commit intopayloadcms:mainfrom
akhrarovsaid:docs/add-getdatabypath-to-react-hooks
Apr 2, 2026
Merged

docs: add getDataByPath to useForm table#12098
paulpopus merged 1 commit intopayloadcms:mainfrom
akhrarovsaid:docs/add-getdatabypath-to-react-hooks

Conversation

@akhrarovsaid
Copy link
Copy Markdown
Contributor

What?

This PR adds the getDataByPath utility function to the useForm table in the docs.

Why?

This utility is useful for dealing with arrays and other form state. Users commonly ask for examples on how to deal with arrays when using useField as this function will return a length instead of the expected value object.

How?

Addition of getDataByPath to the useForm object table in docs/admin/react-hooks.mdx.

@paulpopus paulpopus merged commit 69a49e7 into payloadcms:main Apr 2, 2026
16 checks passed
@akhrarovsaid akhrarovsaid deleted the docs/add-getdatabypath-to-react-hooks branch April 2, 2026 15:42
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 8, 2026

🚀 This is included in version v3.82.0

milamer pushed a commit to milamer/payload that referenced this pull request Apr 20, 2026
<!--

Thank you for the PR! Please go through the checklist below and make
sure you've completed all the steps.

Please review the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository if you haven't already.

The following items will ensure that your PR is handled as smoothly as
possible:

- PR Title must follow conventional commits format. For example, `feat:
my new feature`, `fix(plugin-seo): my fix`.
- Minimal description explained as if explained to someone not
immediately familiar with the code.
- Provide before/after screenshots or code diffs if applicable.
- Link any related issues/discussions from GitHub or Discord.
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Fixes #

-->
### What?
This PR adds the `getDataByPath` utility function to the `useForm` table
in the docs.

### Why?
This utility is useful for dealing with arrays and other form state.
Users commonly ask for examples on how to deal with arrays when using
`useField` as this function will return a length instead of the expected
value object.

### How?
Addition of `getDataByPath` to the `useForm` object table in
`docs/admin/react-hooks.mdx`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants