Skip to content

Commit c16a084

Browse files
committed
v7.46.0
- doc update - fix active state for side menu
1 parent 529be8f commit c16a084

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

src/components/Menu/Menu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Pages } from "../../types/types"
77

88
function Menu({ pages = [] }: { pages: Pages }) {
99
const router = useRouter()
10-
const { pathname } = router
10+
const { asPath: pathname } = router
1111

1212
return (
1313
<aside className={styles.menu}>

src/components/UseController.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import UseControllerContent from "./UseControllerContent"
66
import StarRepo from "./StarRepo"
77
import { Menu, apiLinks } from "./Menu"
88

9-
export default function UseFieldArray() {
9+
export default function UseController() {
1010
return (
1111
<div className={containerStyles.container}>
1212
<h1 className={typographyStyles.headingWithTopMargin} id="main">

src/content/docs/usecontroller/controller.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ The following table contains information about the arguments for `Controller`.
2222
| `defaultValue` | <TypeText>unknown</TypeText> | | **Important:** Can not apply `undefined` to `defaultValue` or `defaultValues` at `useForm`. <ul><li>You need to either set `defaultValue` at the field-level or `useForm`'s `defaultValues`. `undefined` is not a valid value.</li><li>If your form will invoke `reset` with default values, you will need to provide `useForm` with `defaultValues`.</li><li>Calling `onChange` with `undefined` is not valid. You should use `null` or the empty string as your default/cleared value instead.</li></ul> |
2323
| `rules` | <TypeText>Object</TypeText> | | Validation rules in the same format for [`register` options](/docs/useform/register#options), which includes:<br/><br/>required, min, max, minLength, maxLength, pattern, validate |
2424
| `shouldUnregister` | <TypeText>boolean = false`</TypeText> | | Input will be unregistered after unmount and defaultValues will be removed as well.<br/><br/>**Note:** this prop should be avoided when using with `useFieldArray` as `unregister` function gets called after input unmount/remount and reorder. |
25+
| `disabled` | <TypeText>boolean = false`</TypeText> | | `disabled` prop will be returned from `field` prop. Controlled input will be disabled and its value will be omitted from the submission data. |
2526

2627
### Return
2728

src/data/api.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2824,6 +2824,22 @@ setValue('notRegisteredInput', { test: '1', test2: '2' }); // ✅ sugar syntax t
28242824
</p>
28252825
</td>
28262826
</tr>
2827+
<tr>
2828+
<td>
2829+
<code>disabled</code>
2830+
</td>
2831+
<td>
2832+
<code className={typographyStyles.typeText}>boolean = false</code>
2833+
</td>
2834+
<td></td>
2835+
<td>
2836+
<p>
2837+
<code>disabled</code> prop will be returned from `field` prop.
2838+
Controlled input will be disabled and its value will be omitted
2839+
from the submission data.
2840+
</p>
2841+
</td>
2842+
</tr>
28272843
</tbody>
28282844
),
28292845
tips: (

0 commit comments

Comments
 (0)