Skip to content

Commit 0e18a7f

Browse files
committed
Extended description
1 parent c4b9d5d commit 0e18a7f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/content/ts.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function App() {
5656

5757
## \</> SubmitHandler {#SubmitHandler}
5858

59-
This type defines the shape of the data that is used in the submit handler. By default the type will be the same as the type used for `useForm` {#UseFormReturn}. When form data gets transformed via resolvers, an additional type is used as the third type parameter for `useForm`. This type should also be used for the submit handler so that the correct shape of the transformed form data is used inside the submit handler.
59+
This type describes the shape of the data that is passed to the submit handler. By default the type used in the angle brackets should be the same as the type used for `useForm` ({#UseFormReturn}). When form data is transformed into a different shape via resolvers, a different type that describes the new shape of the form data should be used instead.
6060

6161
```typescript copy sandbox="https://codesandbox.io/s/react-hook-form-handlesubmit-ts-v7-z9z0g"
6262
import React from "react"
@@ -126,6 +126,8 @@ export default function App() {
126126

127127
## \</> UseFormReturn {#UseFormReturn}
128128

129+
The first type used in the angle brackets describes the shape of the form data. It should be the same type used in the submit handler function ({#SubmitHandler}) unless the form data is transformed via resolvers. In that case an additional type can be used as a third parameter inside the angle brackets, which describes the shape of the form data after transformation.
130+
129131
<TabGroup buttonLabels={["Type", "Code Example"]}>
130132

131133
```typescript copy

0 commit comments

Comments
 (0)