create-react-app
零配置快速构建项目
官方文档地址:https://www.html.cn/create-react-app/docs/getting-started/
创建项⽬: npx create-react-app my-app
打开项⽬: cd my-app
启动项⽬: npm run start
暴露配置项: npm run eject
JSX基本语法
// 修改index.js
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
// import App from './App';
import reportWebVitals from './reportWebVitals';
// 变量
const text = "hello";
// 对象
const obj = {
name: "josie",
age: 99,
}
// 函数
const formatInfo = (info)=>(
`name:${info.name},age:${info.age}`
)
// jsx对象
const msg = &l