Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using useFieldArray, shouldUseNativeValidation: true and joiResolver together causes a bug #692

Open
ZzzZeta opened this issue Jun 13, 2024 · 0 comments

Comments

@ZzzZeta
Copy link

ZzzZeta commented Jun 13, 2024

Describe the bug

TypeError: Cannot read properties of undefined (reading 'refs')

    at i (https://hdv5hj.csb.app/node_modules/
hookform/resolvers/dist/resolvers.js:1:357
    at Object.t [as validateFieldsNatively] (https://hdv5hj.csb.app/node_modules/
hookform/resolvers/dist/resolvers.js:1:431
    at u (https://hdv5hj.csb.app/node_modules/
hookform/resolvers/joi/dist/joi.js:1:688
async Object.R [as _executeSchema]
https://hdv5hj.csb.app/node_modules/react-hook-form/dist/index.cjs.js:1:14139

} else if (field.refs) {

field is undefined here.

To Reproduce
Steps to reproduce the behavior:

  1. Click on 'APPEND'
  2. Click on 'SUBMIT QUERY'
  3. Click on 'APPEND'
  4. See error

Codesandbox link (Required)
https://codesandbox.io/p/sandbox/react-hook-form-joiresolver-hdv5hj

Expected behavior
The error should not happen.

Screenshots

Desktop (please complete the following information):

  • OS: Windows
  • Browser
    • Chrome 126.0.6478.57
    • Edge 125.0.2535.92
    • Firefox 127.0

Smartphone (please complete the following information):

  • Device: Samsung Galaxy
  • OS: Android 14
  • Browser
    • Firefox 126.0.1

Additional context
None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant