Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: SVG attributes linted incorrectly #3077

Closed
JESii opened this issue Sep 18, 2021 · 1 comment
Closed

BUG: SVG attributes linted incorrectly #3077

JESii opened this issue Sep 18, 2021 · 1 comment

Comments

@JESii
Copy link

JESii commented Sep 18, 2021

React V17.0.2
eslint throwing Unknown property 'font-weight' found, use 'fontWeight' instead react/no-unknown-property for valid properties on SVG elements. There's a whole trail of issues around this, including a fix that was reverted. See #718 for example.

This code is valid:

          <tspan font-weight="bold" ref={tooltipAllocation}>
            9.9%
          </tspan>

but incorrectly throws the above error.

@ljharb
Copy link
Member

ljharb commented Sep 19, 2021

You can see in this fiddle: https://jsfiddle.net/johyr6zw/ that react throws the same error, which means the lint error is correct.

In react, you can’t use “font-weight”, you must use fontWeight.

@ljharb ljharb closed this as completed Sep 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants