react-script-hook

JSON →
library 1.7.2 ·javascript
verified Apr 27, 2026

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.

total hits 11
actors 4 distinct systems
last hit 1d ago AhrefsBot
GPTBot
5
ClaudeBot
1
Search engines
1
Humans
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇮🇹 Italy · 🇬🇧 United Kingdom