All React components must act like pure functions with respect to their props.
1.Create React App
react,react-dom,react-script,babel,webpack。支持HMR。
主页为:src/index.js
npx create-react-app my-app
cd my-app
npm start
2.Next.js
Next.js 是一个轻量级的 React 服务端渲染应用框架。react,react-dom,next,babel,webpack。支持HMR。
主页为:pages/index.js
npm install --save next react react-dom
在package.json中添加
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
}
在pages文件中添加index.js
export default () => <div>Welcome to next.js!</div>
3.Gatsby
Gatsby is the best way to create static websites with React.
npx gatsby new gatsby-site
cd gatsby-site
npm run develop
4.Redux
5.dva.js
https://dvajs.com/
https://www.jianshu.com/p/e184cd6d253c (dva核心概念)
$ npm install dva-cli -g
$ dva new dva-quickstart
$ cd dva-quickstart
$ npm start
网友评论