“element ‘h1’ has no corresponding closing tag.ts”. I have noticed that this is VS Code Editor’s formatter issue. Basically when you save your code, the formatter get confuse between JS & JSX.
Also if you are using “Prettier – Code formatter” VS Code extension, then it might be happening for that reason also. But you still want to use Prettier – Code formatter, then that extension should be the last installed extension in your VS Code editor. You cannot install any other extension after installing that.
Then follow this steps: (If you already have Prettier installed)
- Uninstall Prettier.
- Restart VS Code.
- Install Prettier Again.
- Restart VS Code.
Follow those 4 steps and your issue should be solved.
Get 200+ Hours Free Courses.
Question Answered:
- JSX element ‘h1’ has no corresponding closing tag.
- VsCode (Ctrl + K + D) – JSX element has no correspondig closing tag.
- Expected corresponding JSX closing tag for input Reactjs.
- React Syntax Error : Expected corresponding JSX closing tag for <img>.
- Question : JSX element ‘h1’ has no corresponding closing tag.
- MDB React Element has no corresponding closing tag.
- JSX element ‘h1’ has no corresponding closing tag.ts(17008).
- Jsx Element ‘H1’ Has No Corresponding Closing Tag – ADocLib.
- Why does Div not have corresponding JSX closing tag?
- JSX has no corresponding closing tag. ts(17014) – STACKOOM.
- Syntax error Expected corresponding JSX closing tag for img.
- jsx expressions must have one parent element.
- JSX closing tag for div.
- Got expected corresponding jsx closing tag for section.
- Expected JSX closing tag for img.
- Corresponding jsx closing tag for p.
- Now Expected corresponding JSX closing tag for section.
- expected corresponding jsx closing tag for <hr>.
- React jsx closing tag for input.
- React JSX element T has no corresponding closing tag.
- jsx element has no corresponding closing tag typescript.
- jsx element ‘div’ has no corresponding closing tag vscode.