marsidev / react-turnstile

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

Prevent injecting script multiple times #72

Closed marsidev closed 5 months ago

marsidev commented 5 months ago

This PR intends to fix #70

Previously, when we had multiple widgets in the same page, we injected a Turnstile script per widget. This caused some warnings in the console.

This was fixed by changing the behavior for injecting the script. We were inspired by this other library: Le0Developer/react-turnstile. 🙌

Now we always use a single script.

We also fixed a problem with the cleanup function, also mentioned in the issue.

codesandbox[bot] commented 5 months ago

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

vercel[bot] commented 5 months 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 Jun 3, 2024 8:54pm
VladChernikovCap commented 5 months ago

thank you guys!