react-google-recaptcha issue when changing pages

Viewed 144

Added google-recaptcha to my app everything working great, The only issue is that when I change pages/components the badge on the right side of the screen disappears (but still working in the background). By the way if I reload the page with f5 it appears again!

1 Answers

Depending on your environment, for React 18 in strict mode, it seems to be a known issue with this library. Here is the actual issue in the library's repository

Apparently, it is only an issue in the development mode. By removing <React.StrictMode> from the index.js now my component is rerendering.

Again, this solution would depend on the project and the environment.

Related