-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
TSX Files, Typescript, and React #7344
Comments
This is a consequence of |
I fresh installed emacs and spacemacs on windows 10. I enabled typescript, react, html, and javascript layers, and .tsx files open in foundation mode for me. |
Of course, immediately after posting that, it loads correctly in web-mode. I don't think I did anything to fix it. The last thing I changed was the start directory on my emacs shortcut. |
Updated after seeing that there is already proper support for TSX files. :) |
With a .tsx file in Web mode, how does one format the buffer? |
Does anyone know if this is being worked on? |
+1 |
This is highly annoying. Can we at least hack it so that |
@pmiddend it shouldn't be too hard to do that. it's somewhat of a upstream issue (somewhat).
Also I agree it's extremely annoying. This took me a couple days to figure out. |
Quick workaround:
in dotspacemacs/user-config |
If |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid! |
Thanks. Finally, TSX works for me. I think it should be documented to support TSX both HTML and TS layers should be enabled. |
… able to support .tsx files) syl20bnr/spacemacs#7344
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid! |
Description
When a
tsx
file is opened, it is treated as a JS file withreact-mode
and without TypeScript's helpers. What's being used to autoselectreact-mode
should not be applicable to TypeScript files.A more long term solution would be to supportEDIT: I see thattsx
by incorporating pieces of thereact
layer into thetypescript
layer (or vice versa) but at least for now stopping the mode change would be helpful.tsx
usesweb-mode
.Reproduction guide 🪲
typescript
andreact
layers are installed.template.tsx
:Observed behaviour: 👀 💔
File is opened in
react-mode
with JS packages.Expected behaviour: ❤️ 😄
File is opened in
typescript-mode
(or maybereact-mode
)web-mode
with TS packages.System Info 💻
The text was updated successfully, but these errors were encountered: