question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extension doesn't work with modules like "classnames"

See original GitHub issue

Extension autocomplete doesn’t work in code like this:

import cx from "classnames"

...

<div className={cx("flex flex-row justify-center items-center", { "mr-2": align === "right", "ml-2": align === "left" })}></div>

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
alexanderniebuhrcommented, Dec 15, 2021

There are many reasons why this issue did not get any more bandwidth or attention, one being not clear enough what is broken by providing a test repo, another that we don’t use tsx files at all.

I think there is a fix to this, and it would be great if it will get fixed at some point. But upfront there is very little chance that we have time right now for this. We do accept PRs with a solution as well with a way to support tsx natively without the includeLanguages setting.

1reaction
galkatz373commented, Dec 10, 2021

This should work

"windicss.includeLanguages": {
    "typescriptreact": {
      "type": "js",
      "patterns": ["(\\s+class(Name)?\\s*=\\s*{?\\s*(cx\\((.*[{,]\\s?)?)?[\"'\\`])[^\"'\\`]*$"]
    }
  },
Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue with classnames library in React (mainly classes ...
I have css modules so this was a good way of making a class work when my state is changed. This is my...
Read more >
Chainable class names for CSS Modules in React - Sandro Roth
React accepts a single string as className. ... The utility function will work with CSS Modules, so the actual class names are hashed....
Read more >
css-loader | webpack - JS.ORG
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
Different Ways to Write CSS in React
And maintainability is less of an issue in React, as the CSS often ... CSS Modules allows us to use the same class...
Read more >
A complete guide to CSS Modules in React (Part-1) - codeburst
The issue with this approach is that by importing CSS in global scope, we ... not realizing that the same class name was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found