Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-script-hook

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-script-hook - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

9

lib/use-script.d.ts

@@ -1,4 +0,5 @@

export default function useScript({ src, ...attributes }: HTMLScriptElement): {
loading: boolean;
error: ErrorEvent | null;
};
export interface ScriptProps {
src: HTMLScriptElement['src'];
[key: string]: any;
}
export default function useScript({ src, ...attributes }: ScriptProps): (boolean | ErrorEvent | null)[];

@@ -39,6 +39,3 @@ "use strict";

}, [src]);
return {
loading: loading,
error: error
};
return [loading, error];
}

@@ -45,0 +42,0 @@ exports.default = useScript;

{
"name": "react-script-hook",
"version": "1.0.3",
"version": "1.0.4",
"description": "React hook to dynamically load an external script and know when its loaded",

@@ -5,0 +5,0 @@ "keywords": [

@@ -25,3 +25,3 @@ # react-script-hook

function App() {
const { loading, error } = useScript({ src: 'https://js.stripe.com/v3/' });
const [loading, error] = useScript({ src: 'https://js.stripe.com/v3/' });

@@ -28,0 +28,0 @@ if (loading) return <h3>Loading Stripe API...</h3>;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc