Skip to content

Commit 7c2a5e7

Browse files
committed
Added disabled field to form state
1 parent aba29e6 commit 7c2a5e7

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/components/FormStateApi.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export const FormStateApi = ({
2121
isValidating: ReactNode | string
2222
isLoading: ReactNode | string
2323
validatingFields: ReactNode | string
24+
disabled: ReactNode | string
2425
}
2526
}
2627
columnIndent?: boolean
@@ -221,5 +222,19 @@ export const FormStateApi = ({
221222
component to retrieve error message easily.
222223
</td>
223224
</tr>
225+
<tr>
226+
{columnIndent && (
227+
<td>
228+
<code>formState</code>
229+
</td>
230+
)}
231+
<td>
232+
<code>disabled</code>
233+
</td>
234+
<td>
235+
<code className={typographyStyles.typeText}>boolean</code>
236+
</td>
237+
<td>{(api || API).formState.disabled}</td>
238+
</tr>
224239
</>
225240
)

src/data/api.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,16 @@ setValue('test', '')
792792
Capture fields which are getting async validation.
793793
</>
794794
),
795+
disabled: (
796+
<>
797+
Set to <code>true</code> if the form is disabled via the{" "}
798+
<code>disabled</code> prop in
799+
<Link href="/docs/useform" aria-label="read more about reset api">
800+
useForm
801+
</Link>
802+
.
803+
</>
804+
),
795805
},
796806
errors: {
797807
title: "errors",

0 commit comments

Comments
 (0)