Skip to content

Unknown property 'jsx' found react/no-unknown-property #40269

Discussion options

You must be logged in to vote

This is a workaround to ignore the invalid/nonstandard jsx property on a style tag. Just posting for those who might get confused or lost in the thread.

Create a .eslintrc.json file if it's not existing on your project already, then add this rule.

{
  "rules": {
    "react/no-unknown-property": [
      2,
      {
        "ignore": [
          "jsx"
        ]
      }
    ]
  }
}

Remember, other custom property names must be prefixed with data- to be valid.

Replies: 5 comments 13 replies

Comment options

You must be logged in to vote
1 reply
@Chamberlainfrancis
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@George-Miao
Comment options

@joshuaolusayo
Comment options

@ljharb
Comment options

@George-Miao
Comment options

@joshuaolusayo
Comment options

Comment options

You must be logged in to vote
5 replies
@stackaccount1
Comment options

@Chenzo
Comment options

@midotek
Comment options

@omerisk1
Comment options

@ifightcode
Comment options

Answer selected by Chamberlainfrancis
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet