React Async Script
react-async-script
A composition mixin for loading scripts asynchronously for React
Utilities
react
asynchronous
script-loader
react-async-script
Utilities
javascript
npm
frontend
open source
ui
Stars
177
Weekly
924k
Open issues
6
Bundle
~25 kB
Installation
npm install react-async-scriptCode example
import { useAsyncScript } from "react-async-script";
export function Example() {
const value = useAsyncScript();
return <p>{String(value)}</p>;
}Pros & cons
Pros
- Actively maintained by Hugo Dozois
- 924k weekly downloads. Battle tested
- MIT licensed
Considerations
- Adds roughly ~25 kB to your bundle
- Needs client-only rendering in SSR frameworks
- Not supported in React Native
- 6 open issues on GitHub