首页 > 其他 > 详细

React 创建项目和目录介绍

时间:2021-07-09 12:37:49      阅读:14      评论:0      收藏:0      [点我收藏+]

react脚手架创建项目

全局安装

npm install -g create-react-app

切换到想创建的目录,使用命令

create-react-app hello-react

进入项目文件夹

cd hello-react

启动项目

npm start

react 脚手架项目目录

public 静态文件

favicon 页角标

index.html 页面总入口

<meta name="theme-color" content="#000000" />

  • 仅仅支持安卓部分手机游览器顶部地址栏的背景颜色

<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />

  • 用于苹果手机指定网页添加到手机主屏幕的图标

<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />

  • 应用加壳时的配置文件

robots.txt 爬虫规则文件

manifest.json 应用加壳配置

src

APP.js 组件总入口

APP.css APP.js的css

App.test.js 给 APP.js 做测试的

index.js 入口文件

ReactDOM.render(
  <React.StrictMode> //检查代码有无不合理的地方
    <App />
  </React.StrictMode>,
  document.getElementById(‘root‘)
);

index.css 公共css

reportWebVitals 记录页面性能检测

setupTests 组件测试

React 创建项目和目录介绍

原文:https://www.cnblogs.com/landuo629/p/14988768.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!