react-script-hook
JSON →A React hook for dynamically loading external scripts and tracking their load state. Current stable version is 1.7.2. The package is actively maintained with regular updates. It provides a simple API: call useScript with a script URL and get loading/error states. Key differentiators: automatic deduplication (multiple components loading the same script share a single request), support for onload callbacks, a checkForExisting flag for environments where the script may already be present, and conditionally loading by setting src to null. Includes TypeScript definitions and supports React 16.8.6 through 18.
Traffic · last 30 days ↓33% vs prev 7d
total hits 11
actors 4 distinct systems
last hit 1d ago AhrefsBot
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇮🇹 Italy · 🇬🇧 United Kingdom
Resources
API endpoints
full doc /v1/registry/react-script-hook