1.13.0 • Published 24 days ago

@s-ui/react-script-loader v1.13.0

Weekly downloads
744
License
MIT
Repository
-
Last release
24 days ago

ScriptLoader

Description

This components ensures that the render prop is not executed until the given script has been loaded. Also you can safely call this component in multiple places with the same src and it will load it only once.

Installation

$ npm install @s-ui/react-script-loader --save

Usage

Basic usage

import ScriptLoader from '@s-ui/react-script-loader'

const src = 'javascript file url'
const stylesheet = 'stylesheet file url'

return (<ScriptLoader src={src} verifier={() => true} isAsync={false} render={() => 'Ready to render!'} stylesheet={stylesheet}/>)

Find full description and more examples in the demo page.