'Bracket auto close in JSX/HTML component
When I input the {
in the middle of any JSX/HTML component, the VSCode
is not closing it - have you got any ideas how to configure settings or is there any extension for auto-close?
Example:
const MathButton = (props) => {
return (
<div>
<button>{</button>
</div>
);
};
Solution 1:[1]
Add this to settings.json
in VS Code
:
"editor.autoClosingBrackets": "always"
or
Go to:
File -> Preferences -> Settings -> Auto closing Brackets
Change it to always
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Matin Sasan |