React开发中与JSX的不同点
style参数
在JSX中须要使用对象的方式给style属性赋值;在NornJ模板中可以直接使用与html完全相同的style语法:
<div style="color:purple;font-size:1rem;">test</div>
class和for参数
在JSX中须要使用className和htmlFor来给class和for赋值;在NornJ模板中可以直接使用与html完全相同的参数名:
<input type="checkbox" name="test" class="cbx" />
<label for="test">test</label>