Create React Project

npm -v
note -v
mkdir projectfolder
cd projectfolder
npm init -y # generate package.json
npm -i webpack --save-dev
config in package.json such as "build": “webpack --mode production”
npm i babel-loader babel-core babel-preset-env babel-preset-react --save-dev
npm install --save-dev @babel/core @babel/cli save to project

npm run build
babel src -d lib

npx create-react-app myapp1

or use npx create-snowpack-app react-snowpack --template @snowpack/app-template-react

npm start

 

component
webpack Webpack 是一个前端资源加载/打包工具,只需要相对简单的配置就可以提供前端工程化需要的各种功能,并且如果有需要它还可以被整合到其他比如 Grunt / Gulp 的工作流。 http://caibaojian.com/react/webpack.html
Babel 解决浏览器兼容问题 https://www.cnblogs.com/L-xmin/p/12806844.htmla

 

 

debug
npm start
install debugger for chrome for vscode plugs
check port in launch.json  

React创建组件两种写法:React.createClass和extends Component的区别

https://www.cnblogs.com/fightjianxian/p/12350499.html

posted @ 2022-10-18 15:42  CrazyJC  阅读(24)  评论(0编辑  收藏  举报