比较了 3 个我比较喜欢的项目
- create-react-app
- antd-pro
- umi-user-dashboard
结论:
- mock/ mock api
- public/ web 相关配置文件
<figure class="third">
<img src="http://xxx.jpg">
<img src="http://yyy.jpg">
<img src="http://zzz.jpg">
</figure>
如果 JavaScript 运行依赖
HTML,放在 body。
包含 ReactDOM.render() 的 JavaScript or 业务逻辑
如果 JavaScript 运行不依赖
HTML,放在 head 中。
如 jQuery.js
package.json 中添加配置
"jest": {
"testURL": "http://localhost/",
高阶组件就是一个函数,且改函数接受一个组件作为参数,并返回一个新的组件。