Content-Length: 311089 | pFad | https://github.com/payloadcms/payload/commit/69a49e7

2B docs: add getDataByPath to useForm table (#12098) · payloadcms/payload@69a49e7 · GitHub
Skip to content

Commit 69a49e7

Browse files
authored
docs: add getDataByPath to useForm table (#12098)
<!-- 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`.
1 parent df03ed0 commit 69a49e7

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

docs/admin/react-hooks.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,17 @@ The `useForm` hook returns an object with the following properties:
348348
value: '',
349349
},
350350
],
351+
[
352+
{
353+
value: "**`getDataByPath`**",
354+
},
355+
{
356+
value: 'Returns form field data for the given field path. Useful when dealing with arrays, blocks, or other form state.',
357+
},
358+
{
359+
value: '',
360+
},
361+
],
351362
[
352363
{
353364
value: "**`setModified`**",

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/payloadcms/payload/commit/69a49e7

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy