marsidev / react-turnstile

Cloudflare Turnstile integration for React.
https://www.npmjs.com/package/@marsidev/react-turnstile
MIT License
414 stars 25 forks source link

Add onError to scriptOptions #41

Closed IanVS closed 1 year ago

IanVS commented 1 year ago

Closes https://github.com/marsidev/react-turnstile/issues/40

This adds an onError option to scriptOptions, which adds an onerror to the script that is injected into the DOM, so that devs can handle failures to load the Cloudflare script, such as when Cloudflare workers, turnstile, and pages recently were down for 25 minutes.

I wasn't able to test the docs locally, since pages.dev has an issue with local previews, but I think it'll just get picked up automatically?

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-turnstile ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 31, 2023 1:26pm
IanVS commented 1 year ago

It looks like a preview for the docs is not generated by the vercel bot either.

marsidev commented 1 year ago

Hey @IanVS, thanks for contributing!

Can you please add the new script option property into docs/props.mdx? (at the very end)

IanVS commented 1 year ago

Ah, I thought maybe they got pulled from the type definitions automatically. Updated the mdx.

marsidev commented 1 year ago

Thank you!

IanVS commented 1 year ago

Thanks for the quick review/merge/release!