#创建react应用
1. npm install create-react-app -g
html写在了哪个js文件中,就在哪个js文件中引入css。
react中引用静态资源也要使用模块化的方式,比如<img src="/img/a.jpg"/>是不行的,要用import abc from '/img/a.jpg';
react组件中的方法不能直接调用this.state,必须绑定this后才可以
![image](https://img.haomeiwen.com/i7538970/090df586b8ce482d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
li当中要有key值
![](https://img.haomeiwen.com/i7538970/47a166ca59824c16.png)
网友评论