buntal - components

Script

External script loader component that dynamically loads JavaScript files and manages script lifecycle with automatic cleanup.

Source

View source on GitHub

Type Definition

function Script({
  src,
  ref,
  ...props
}: {
  src: string
  ref?: React.Ref<HTMLScriptElement>
} & React.ScriptHTMLAttributes<HTMLScriptElement>): JSX.Element

Parameters

ParameterTypeRequiredDefaultDescription
srcstring-URL of the JavaScript file to load
refReact.Ref<HTMLScriptElement>-Reference to the script element
...propsReact.ScriptHTMLAttributes<HTMLScriptElement>-Additional HTML script element attributes (async, defer, etc.)

Last modified: 2025-06-10

Content-Length: 0