Skip to content

Custom/arbitrary attributes on script tag cause a type error #292

Open
@Ingramz

Description

@Ingramz

🐛 The bug

Some scripts may require attributes do not have a data- prefix. It is possible pass them to a script like this:

useScript({
  src: 'https://chat.askly.me/cw/chat/latest.js',
  async: true,
  crossorigin: false,
  'tw-client-key': clientKey,
})

and it will work. However since it is not a recognized key, TypeScript will complain about this.

Documentation shows that there is attributes?: Record<string, string>, however this does not seem to be true either.

🛠️ To reproduce

See above

🌈 Expected behavior

No type errors, either by allowing arbitrary string/string key value pairs or by providing a documented way to augment the type.

ℹ️ Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions