dozoisch / dozoisch/react-google-recaptcha

Component Keeps Creating Divs

Open
#217 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.1k
Forks
148
PR merge metrics
No merged PRs in 30d

Description

react-google-recaptcha version: 2.1.0
react-async-script version: 1.2.0

So I am working on a NextJS app, and I have the captcha on one of the pages - the contact page - and whenever I navigate away from and back to the contact page, the ReCaptcha component will append a new div to the document.

The script tag will also persist on client-side route changes, but does not duplicate itself like the div seems to.

going down the html tree, eventually I get to an iframe with the title "recaptcha challange."

It DOES seem to disappear for a second but very shortly comes back, (Screenshots below)

The code is publicly available at https://github.com/stream-pi/website

Some more noteworthy findings:
- happens in dev and prod
- issue only seems to occur when switching routes via the client (client-side routing)
- this issue happens with multiple types of captcha (invisible and checkbox)

I can provide any more information on request, any help would be greatly appreciated

![image](https://user-images.githubusercontent.com/51345689/126413880-9d2b3700-6910-40f2-bf52-e4062ba7bc5e.png)
![image](https://user-images.githubusercontent.com/51345689/126413883-73e1f15d-573c-44b8-b15e-c967b514d913.png)
![image](https://user-images.githubusercontent.com/51345689/126413886-4777bd53-7a02-4754-9979-9cd33a375ab1.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.