jsun969 / react-hook-form-antd

๐Ÿ“‹๐Ÿœ Master your Ant Design form with React Hook Form! ็”จ React Hook Form ๆ‹ฟๆไฝ ็š„ Ant Design ่กจๅ•๏ผ
https://npm.im/react-hook-form-antd
MIT License
61 stars 10 forks source link

Fix: Ensure Values Update When Removing Elements in Listed Component by Watching name in useEffect Dependencies #99

Closed nagamejun closed 1 month ago

nagamejun commented 1 month ago

When removing elements in a listed component, the values are not updated. This is because the name is not being watched in the useEffect dependencies. A warning should be output by ESLint as well.

$ eslint "src/FormItem.tsx"

~/works/react-hook-form-antd/src/FormItem.tsx
  13:38  error    Unexpected any. Specify a different type                                                                              @typescript-eslint/no-explicit-any
  32:5   warning  React Hook useEffect has missing dependencies: 'form' and 'name'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

โœ– 2 problems (1 error, 1 warning)
jsun969 commented 1 month ago

@all-contributors please add @nagamejun for bug and code

allcontributors[bot] commented 1 month ago

@jsun969

I've put up a pull request to add @nagamejun! :tada: