Skip to content

JSX SVG Typescript type error: missing 'slot' attribute #2427

@apprat

Description

@apprat

Describe the bug

Image

Your Example Website or App

none

Steps to Reproduce the Bug or Issue

function App() {
  return (
    <>
      <s-button>
        <svg slot="start" xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960">
          <path d="M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"></path>
        </svg>
      </s-button>
    </>
  )
}

Expected behavior

The slot attribute should be added optionally as slot?: string in the interface SvgSVGAttributes {}.

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    PRs WelcomeAn issue which might not be prioritized right away but would be open to community contributiontypescriptrelating to typescript or types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions