eslint-plugin-react: Getting wrong error "Strings not allowed in JSX files" in prop

I’m getting error in this:

<div className={`col-12 grid input-cont ${shouldUseDefaultClasses && defaultContClass} ${contClass}`}>

The error is:

error  Strings not allowed in JSX files: “`col-12 grid input-cont ${shouldUseDefaultClasses && defaultContClass} ${contClass}`”  react/jsx-no-literals

There is no string in the className, not sure what am I missing here.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 21 (21 by maintainers)

Most upvoted comments

Yep, now that it’s merged. Thanks!

@ljharb I’ve created a pull request for the issue, but when I see in test file, it doesn’t allow strings in props. I’ve updated the test in PR tho. Just wanted to make sure if we are on the same page.

Absolutely!

can I create a PR…