一、插值语法 – {}
const str = 'hello react';
const VDOM = <h1>{str}</h1>; // 注意:是一对大括号 {} 和 Vue( {{}} ) 区分开
二、给标签添加类名 – className= "" | {}
/*css:.active {background-color: red;}
*/const VDOM = <h1 className="active">hello react</h1>;
三、内联样式 – style={{ }}
const VDOM = <h1 style={{color: 'red', fontSize: '100px'}}>hello react</h1>;
四、标签必须闭合
<input type="text" />
<img src="" />
...
五、只能有一个根标签
const VDOM = ( // 如果有很多标签,推荐外面包一个小括号<div><h1 className="active">hello react</h1><input type="text" /></div>
);