Skip to content

Doesn't work for TSX files #72

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

Closed
arimendelow opened this issue Sep 23, 2019 · 17 comments
Closed

Doesn't work for TSX files #72

arimendelow opened this issue Sep 23, 2019 · 17 comments

Comments

@arimendelow
Copy link

When using TypeScript with React, this plugin doesn't work. How can I configure it to look at .tsx files?

@lednhatkhanh
Copy link

How did you solve this?

@arimendelow
Copy link
Author

Turns out it’s already got support for it, I’m not sure why it wasn’t working originally but soon after I posted this it started to work.

@or2008
Copy link

or2008 commented Nov 14, 2019

just installed and it doesn't work for me, lets see if this comment fixes it :)

@Manubi
Copy link

Manubi commented Feb 10, 2020

doesn't work for me either in .tsx only if I write "class" instead of "className" I get the autosuggest...

@arimendelow
Copy link
Author

That's weird, it should work without any configuration. I'm still unsure why it didn't for me initially.

@swyxio
Copy link

swyxio commented Mar 28, 2020

same - it didnt work on tsx originally, then i panicked and clicked around and now it works

@bentruyman
Copy link

I also ran into this. Not sure if it's anything TSX-related (but it was failing in TSX files for me). But to fix it I simply created a tailwind.config.js file in my project.

module.exports = {
  theme: {},
  variants: {},
  plugins: [],
};

It seems a config file is what enables this extension in a project.

@exoer
Copy link

exoer commented Jul 16, 2020

In vscode - extensions - Tailwin CSS Intellisense. Click on the settings button ("manage").

Find Tailwind CSS - Include languages
Click 'edit in settings.json'

add
"tailwindCSS.includeLanguages": { "plaintext": "javascript" }

@b-groeneveld
Copy link

I've added

"tailwindCSS.includeLanguages": { "typescriptreact": "html" },

And restarted vscode and it was good to go

@oxyian-dev
Copy link

I've added

"tailwindCSS.includeLanguages": { "typescriptreact": "html" },

And restarted vscode and it was good to go

Super its working for me

@khalidahmada
Copy link

You can add this in user settings

"tailwindCSS.includeLanguages": { "typescript": "javascript", "typescriptreact": "javascript" }

@SHAGGYER
Copy link

doesnt work with custom webpack babel typescript react

@avxkim
Copy link

avxkim commented Dec 17, 2022

@khalidahmada this what it made working for me in Nuxt 3 + TS

@paulwongx
Copy link

You can add this in user settings

"tailwindCSS.includeLanguages": { "typescript": "javascript", "typescriptreact": "javascript" }

@khalidahmada
Can you explain what this is doing? Someone above suggested "typescriptreact": "html" Why typescriptreact: "javascript"?

@Manubi
Copy link

Manubi commented Feb 13, 2023

You can add this in user settings
"tailwindCSS.includeLanguages": { "typescript": "javascript", "typescriptreact": "javascript" }

@khalidahmada Can you explain what this is doing? Someone above suggested "typescriptreact": "html" Why typescriptreact: "javascript"?

You can find more information here:
changelog

package.json

readme

@hamzatalha77
Copy link

just go to tailwind.config.js and add tsx in the model like this:
/** @type {import('tailwindcss').Config} /
module.exports = {
content: ['./src/**/
.{html,js,tsx}'],
theme: {
extend: {},
},
plugins: [],
}
and will works for you ^^

@arsalanmohseni
Copy link

arsalanmohseni commented Jan 11, 2025

Use this for both jsx and tsx(my config):

"tailwindCSS.includeLanguages": {
        "typescriptreact": "html",
        "javascriptreact": "html"
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests