Skip to content

Commit 35d7d0a

Browse files
authored
Fix incomplete path in example snippet
1 parent d154f96 commit 35d7d0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/docs/useform.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,8 @@ npm install @hookform/resolvers
436436
- When building a custom resolver:
437437
- Make sure that you return an object with both `values` and `errors` properties. Their default values should be an empty object. For example: `{}`.
438438
- The keys of the `errors` object should match the `name` values of your fields, but they _must_ be hierarchical rather than a single key for deep errors:
439-
`❌ { "participants.1.name": someErr }` will not set or clear properly - instead, use `✅ { "participants": [null, someErr] }` as this is reachable
440-
as `errors.participants[1]` - you can still prepare your errors using flat keys, and then use a function like this one from the zod resolver:
439+
`❌ { "participants.1.name": someErr }` will not set or clear properly - instead, use `✅ { participants: [null, { name: someErr } ] }` as this is reachable
440+
as `errors.participants[1].name` - you can still prepare your errors using flat keys, and then use a function like this one from the zod resolver:
441441
[toNestErrors(flatErrs, resolverOptions)](https://github.com/react-hook-form/resolvers/blob/master/src/toNestErrors.ts)
442442

443443
</Admonition>

0 commit comments

Comments
 (0)