-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
The current type used for ScriptProps is as follows:
export interface ScriptProps {
src: HTMLScriptElement['src'] | null;
checkForExisting?: boolean;
[key: string]: any;
}Where the type of attributes added to the <script> tag with the exception of the src key are [key: string]: any. As the attributes are specifically added to a <script> tag I believe a better typing might be provided by the following:
type ScriptAttributes = Omit<HTMLScriptElement, 'src'>;
export interface ScriptProps extends ScriptAttributes {
src: HTMLScriptElement['src'] | null;
checkForExisting?: boolean;
}With src omitted for the sake of not stepping on the logic that makes use of the null value.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels