首页 > 解决方案 > I installed React, then I get a typo when I save it

问题描述

I have provided all the necessary institutions for React. Afterwards, when I ctrl s the codes, the js codes try to resemble the js syntax. I am getting the below issue? What can I do?

import logo from './logo.svg';
import './App.css';

function App() {
    return ( <
        div className = "App" >
        <
        header className = "App-header" >
        <
        img src = { logo }
        className = "App-logo"
        alt = "logo" / >
        <
        p >
        Edit < code > src / App.js < /code> and save to reload. <
        /p> <
        a className = "App-link"
        href = "https://reactjs.org"
        target = "_blank"
        rel = "noopener noreferrer" >
        Learn React <
        /a> <
        /header> <
        /div>
    );
}

export default App;

标签: javascript

解决方案


如果您使用Prettier code formatterand vs-code,请打开设置并搜索jsx,然后像下面这样配置它们。

在此处输入图像描述


推荐阅读