Skip to content

Commit 5815afc

Browse files
authored
Document disabled field in formState object (#1090)
* Added explanation for transformed data type and extended listing * Extended description * Fix merge conflict * Added disabled field to form state * Reverted changed * Fixed description * Fixes
1 parent 2e86046 commit 5815afc

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,19 @@ 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
800+
href="/docs/useform#disabled"
801+
aria-label="read more about disabled api"
802+
>
803+
useForm
804+
</Link>
805+
.
806+
</>
807+
),
795808
},
796809
errors: {
797810
title: "errors",

0 commit comments

Comments
 (0)