hCaptcha / react-hcaptcha

hCaptcha Component Library for ReactJS and Preact
MIT License
371 stars 42 forks source link

Issue with react-router-dom and useNavigate() #189

Open GeekCornerGH opened 1 year ago

GeekCornerGH commented 1 year ago

Hello everyone. I'd like to report this issue which returns in console the following error: Only one captcha is permitted per parent container. Here is a code example where I can reproduce the issue To reproduce, use the code sample, then click the providen button, then watch the console I'd like use useNavigate() as much as possible, could you help me? Thanks in advance for your answer.

zoryana94 commented 1 year ago

Hi @GeekCornerGH,

Thank you for notifying us about the issue! And thank you a lot for providing the way to reproduce it! It seems to be a non-blocking issue, as the app is fully functional. Please correct me if I am wrong.

If you will find the possible solution, please do not hesitate to create the PR. We appreciate all the contributions! Meanwhile, I will talk to the team about the further actions. We will keep you posted.

Best Regards, IMI Dev Team

angelsvirkov commented 1 year ago

The issue also occurs with a standard NextJS setup using the built-in navigation.

luizlevindiniz commented 3 weeks ago

I have been having the same problem in nextjs, any solutions?

GeekCornerGH commented 3 weeks ago

I have been having the same problem in nextjs, any solutions?

What I can suggest is to install the dep from npm registry, then patch it using yarn or pnpm

MrPancakes39 commented 3 weeks ago

Patching is a workaround, if #191 fixes it then why not merge it?