hCaptcha/react-hcaptcha

props onLoad is not triggerd at second mount

cai-zhuo opened this issue · 1 comments

Hello~
The Class Component seems only trigger onLoad once if iframe is already mounted,
My scenario is in Next.js App Router, I changed router to /auth/signin from /auth/signup , component Hcaptcha will unmount, but iframe is still existing, so in next time Hcaptcha mounted, it will not trigger onLoad.

thanks for help!

Hi @cai-zhuo ,

Thank you for reaching to us!
That's the expected behavior! The onLoad is triggered when the hCaptcha script is loaded.
You can find more info here.

Right now, we don't have the prop that would be triggered when the new instance of hCaptcha is ready for use.
Please take a look if captchaRef.current?.isReady() could help you.
If you would like to solve some specific issue, please provide us with more details.

Best Regards,
hCaptcha Dev Team