-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Auto close JSX tags. #34307
Comments
I would add that it is desirable that it would work with components as well.
|
@Igorbek it doesn't work for me, auto close tags works in HTML, Handlebars, etc., but not in .js file with JSX syntax. |
It doesn't for me either :) I extended the feature request. That is what I want. |
@Igorbek Oh sorry, I misread your comment 😄 |
no worries, just upvote the feature if you're interested. |
This comment has been minimized.
This comment has been minimized.
FYI for anyone else who runs into this: The "auto close tag" extension (https://github.com/formulahendry/vscode-auto-close-tag) implements this and seems to work quite well. |
@quarleswn I would avoid that extension, it causes errors with eslint and produces intense CPU spikes. It's likely there's some infinite recursion happening somewhere in there. It's detailed here: formulahendry/vscode-auto-close-tag#70 |
Note that the feature described here: #18427 |
Any working solution? |
@PolGuixe As long as the language mode is "Javascript React", it should work |
It's not working as TypeScript React |
Auto tag close not working, this feature is essential. |
+1 it does not work for .tsx files. Auto-closing tags works on html native tags but not on custom and React Native tags |
@gor918 Even with "Javascript React" it's not auto-closing the tags |
For .jsx files with the mode set to JavaScript React, if I type One problem is that the Emmet abbreviation is not always the first option in the auto-complete list, for example with the |
@daphnegold , thanks! I was pulling my hair out trying to figure out why |
Part of #34307. Add manual completions for closing jsx tags. Requires TS 3.0
I've created a small snippet
Type |
Has it been fixed? |
Yep, works for me in VS Code Insider after installing However there is noticeable delay after typing
@mjbvz should I create separate issue for this delay issue if it depends on project size? |
Yes this requires TS 3.0+ which is enabled on VS Code insiders. Please open new issues for any problems you see. @IllusionMH This issue is tracked by microsoft/TypeScript#25552 |
Solution is : CTRL + SHIFT + P then type and select "Change Language Mode". Enter javascriptreat |
Adding this to my user settings fixed it for me:
|
Steps to Reproduce:
<div></div>
</div>
does not auto-insert when you close the opening tagThis is a feature request to make the awesome auto-closing-tag feature work with JSX, instead of just html.
The text was updated successfully, but these errors were encountered: