Installation
npm install --save @types/react-async-script
Summary
This package contains type definitions for react-async-script (https://github.com/dozoisch/react-async-script).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-async-script.
index.d.ts
import * as React from "react";
import hoistNonReactStatics = require("hoist-non-react-statics");
interface Options {
attributes?: { [key: string]: string } | undefined;
callbackName?: string | undefined;
globalName?: string | undefined;
removeOnUnmount?: boolean | undefined;
scriptId?: string | undefined;
}
/**
* The Higher order Component function
*
* @param url
* @param options
*/
declare function makeAsyncScript(
url: string,
options?: Options,
): <P>(
Component: React.ComponentType<P>,
) => React.ComponentType<
& P
& hoistNonReactStatics.NonReactStatics<React.ComponentType<any>>
& {
asyncScriptOnLoad?: (() => void) | undefined;
}
>;
export = makeAsyncScript;
Additional Details
- Last updated: Tue, 07 Nov 2023 0939 GMT
- Dependencies: @types/hoist-non-react-statics, @types/react, hoist-non-react-statics
Credits
These definitions were written by Michalis Zachariadis.