Skip to content

react/no-unknown-property: allow viewbox on symbol #3426

Closed
@pgrippi

Description

@pgrippi

Similar to #3416 but for symbol instead of marker

using version 7.31.7

https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/viewBox

I have a component that looks like:

<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em">
  <symbol viewBox="0 0 24 24" id="..." xmlns="http://www.w3.org/2000/svg">
    <path
      fill="currentColor"
      d="..."
    />
  </symbol>
</svg>

And it's throwing an error:

error  Invalid property 'viewBox' found on tag 'symbol', but it is only allowed on: svg  react/no-unknown-property

it might be good to also add it for pattern and view as those tags also accept viewBox according to MDN but are not listed in the allowed tags

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions