react-import-script
Why?
It helps to import scripts from url in a react component when the script is need to be used, hence saving the project startup time rather than loading all the scripts at once.
Installation
npm i react-import-script
yarn add react-import-script
Usage
1. ImportScript
;;; ; { return <div className="App"> <ImportScript url="https://checkout.razorpay.com/v1/checkout.js"> <p>Hello world</p> </ImportScript> </div> ;} ;
Props | Description | required |
---|---|---|
url |
url of any script which needs to be loaded | true |