Skip to content
Discussion options

You must be logged in to vote

Reposting as a top level comment, originally posted here.

I ran into this same issue and have created a codesandox with the reproduction here: https://codesandbox.io/s/react-hook-form-nested-9qtck

Some things to note

  • The form in the Modal is added to the DOM as a child of the <body> element, so it is not a nested form with regards to the DOM. The modal, and the form it contains, are however child components of the containing form, so as far as the React tree is concerned, they are nested. The modal and it's form are added to the <body> by way of using a React Portal, here is a reference to the code where that is done.
  • I believe the issue here is that the Synthetic "submit" event is bubbl…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@Steffi3rd
Comment options

@bluebill1049
Comment options

@adamayres
Comment options

@jonasgroendahl
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@bluebill1049
Comment options

@hornta
Comment options

Answer selected by bluebill1049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants