-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onLoad not called when mounting component in next page after client side navigation #200
Comments
Onload only fires once for a SPA, so this is expected behavior. What are you trying to do in onload? |
I have token generation logic in onload, diffrent for both pages a and b |
Hi @Mohitkumar6122! Thank you for reaching to us! Please try calling hCaptcha execute method inside the
Please let us know if it works for you. Best Regards, |
@zoryana94 Thanks for providing a workaround, but this is the same method as I'm using till now.
But after navigating to page b, ideally it should load a new script and onLoad should work ? |
Hi, @Mohitkumar6122, we check if the script content is loaded, not if the script element is present however, what do you mean by "this is the same method as I'm using till now"?
So, my suggestion is that you call the executeCaptcha as in the example above, not in the onLoad. If that is still not working for you, could you please send us some details of how you've added hCaptcha into your app? or even maybe some test app Best Regards, |
@zoryana94 Thanks for the clarification. |
Also How do you check if the script content is loaded ? |
Hi, @Mohitkumar6122 as far as I remember we're checking for the So, the Also, it might be useful if you send some code implementation example, so that we could propose the possible solution. Best Regards, |
I have 2 pages a and b.
I want to call a secure API and handling the bot request with the help of invisible hcaptcha and verify it on middleware.
I am using it on mount of component of page a but when i am navigating to page b and again navigate back to a.
onload is not running again.
Any ideas what are the scenarios in which onload runs?
and how to prevent this ?
Page a -> Page b -> Page a
captcha working captcha not generating using onload prop
The text was updated successfully, but these errors were encountered: