Closed vsolovev closed 10 months ago
I just exposed an onWidgetLoad
callback that can be helpful for your use case. It runs when the widget loads or resets.
Please take note there are also:
onScriptLoad
callback to run when the turnstile script has been loadedonSuccess
callback for when the widget challenge has been passed Here is an example and comparison between the two packages: https://codesandbox.io/p/sandbox/loving-yalow-fhdpp2?file=%2Fsrc%2FApp.tsx
That's great, thank you!
Feature Currently there is no way to detect when widget is ready to be executed, so explicit "execute" is kinda impossible. The ref.current became valid BEFORE widget loading is completed, thus "Turnstile not loaded" error occured during execution.
Wish to have extra callback when widget completed loading like it's done in another react-turnstile project (onLoad - called when the widget is loaded).