Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
react-external-script-loader
Advanced tools
Library for loading external scripts
npm install react-external-script-loader
yarn add react-external-script-loader
import Loader from 'react-external-script-loader';
...
<Loader url="https://vk.com/js/api/openapi.js?160" global="VK" />
Property | Type | Description |
---|---|---|
url(required) | string | Url of external script |
global(required) | string | name of object if it loads successfully |
options | object | Script options - possible keys: {type, charset, async, defer}. You can ckeck it here |
onLoad | function | Called when script loaded (global: object): void |
onError | function | Called when script loading was failed void |
import Loader from 'react-external-script-loader';
class App extends React.Component {
state = {
load: false,
};
render() {
const { load } = this.state;
return (
<div className="App">
<h1>React External Script Loader Example</h1>
<button onClick={() => this.setState({ load: true })}>
Load external script
</button>
{load && (
<>
<div id="vk_playlist_-2000646569_646569" />
<Loader
url="https://vk.com/js/api/openapi.js?160"
global="VK"
onLoad={VK =>
VK.Widgets.Playlist(
'vk_playlist_-2000646569_646569',
-2000646569,
646569,
'ae82627d6c8bb4500d',
)
}
/>
</>
)}
</div>
);
}
}
const rootElement = document.getElementById('root');
ReactDOM.render(<App />, rootElement);
You can clone this repository and check example
git clone https://github.com/mmarkelov/react-external-script-loader.git
cd ./react-external-script-loader/example
yarn && yarn run dev
FAQs
React component for loading external scripts
The npm package react-external-script-loader receives a total of 310 weekly downloads. As such, react-external-script-loader popularity was classified as not popular.
We found that react-external-script-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.