Skip to content

Commit

Permalink
v7.46.0
Browse files Browse the repository at this point in the history
- doc update
- fix active state for side menu
  • Loading branch information
bluebill1049 committed Sep 3, 2023
1 parent 529be8f commit c16a084
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Pages } from "../../types/types"

function Menu({ pages = [] }: { pages: Pages }) {
const router = useRouter()
const { pathname } = router
const { asPath: pathname } = router

return (
<aside className={styles.menu}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/UseController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import UseControllerContent from "./UseControllerContent"
import StarRepo from "./StarRepo"
import { Menu, apiLinks } from "./Menu"

export default function UseFieldArray() {
export default function UseController() {
return (
<div className={containerStyles.container}>
<h1 className={typographyStyles.headingWithTopMargin} id="main">
Expand Down
1 change: 1 addition & 0 deletions src/content/docs/usecontroller/controller.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The following table contains information about the arguments for `Controller`.
| `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> |
| `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 |
| `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. |
| `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. |

### Return

Expand Down
16 changes: 16 additions & 0 deletions src/data/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2824,6 +2824,22 @@ setValue('notRegisteredInput', { test: '1', test2: '2' }); // ✅ sugar syntax t
</p>
</td>
</tr>
<tr>
<td>
<code>disabled</code>
</td>
<td>
<code className={typographyStyles.typeText}>boolean = false</code>
</td>
<td></td>
<td>
<p>
<code>disabled</code> prop will be returned from `field` prop.
Controlled input will be disabled and its value will be omitted
from the submission data.
</p>
</td>
</tr>
</tbody>
),
tips: (
Expand Down

1 comment on commit c16a084

@vercel
Copy link

@vercel vercel bot commented on c16a084 Sep 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

react-hook-form-website – ./

react-hook-form-website-git-master-hook-form.vercel.app
react-hook-form.com
react-hook-form-website-hook-form.vercel.app

Please sign in to comment.