Skip to content

Commit

Permalink
🚔 close #11937 add validation in the cleanup process in `useControlle…
Browse files Browse the repository at this point in the history
…r` (#11938)

* fix #11937 add validation in cleanup in useController

* Update src/useController.ts

---------

Co-authored-by: Beier (Bill) <bluebill1049@hotmail.com>
  • Loading branch information
nakaakist and bluebill1049 committed May 25, 2024
1 parent b491b29 commit aff0bb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"files": [
{
"path": "./dist/index.cjs.js",
"maxSize": "10.1 kB"
"maxSize": "10.2 kB"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion src/useController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function useController<
const updateMounted = (name: InternalFieldName, value: boolean) => {
const field: Field = get(control._fields, name);

if (field) {
if (field && field._f) {
field._f.mount = value;
}
};
Expand Down

0 comments on commit aff0bb9

Please sign in to comment.