Anik Chakraborty
Anik Chakraborty

Reputation: 21

how to solve code formatter problem in reactjs program?

First Picture contains the program that I am trying to execute in the browser. When I press Ctrl+S to save my changes, vscode automatically changes the format style of the code.

Second Picture showing an error in vscode although it compiles and run successfully in the browser which shows the correct output.

I have tried to enable/disable the Prettier extension but nothing happened.

What is the cause for the problem: npm / react file / vs code.

enter image description here enter image description here

Upvotes: 0

Views: 245

Answers (1)

fullstack
fullstack

Reputation: 834

change file format to javascript-react on the bottom toolbar enter image description here

Upvotes: 1

Related Questions