Async script loading composition for React components, supporting jsonp and multiple script loading. Currently at version 0.1.2, with an API redesign in 0.1.0 that introduced mapScriptsToProps configuration. It provides a higher-order component to load external scripts (e.g., Google Maps) and inject them as props. Unlike libraries like react-loadable, it focuses on script injection rather than code splitting. Package has minimal dependencies: React >=0.13. Release cadence is low, with no newer versions since 2015.
npm install react-async-loaderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: wrap a component with asyncLoad to inject an external script as a prop.
Ensure the script sets a global variable matching the globalPath key.
Consider using newer alternatives like react-loadable or @loadable/component for script loading.
Upgrade to 0.1.0+ and update usage to pass a function that returns config.
Use `const asyncLoad = require('react-async-loader').default;`Check that the script URL is accessible and the globalPath matches a property on window after loading.
Ensure the script sets the expected global variable. Consider using jsonp: true if the script supports JSONP callbacks.