Reactjs 通过reactify在JSX中没有类
我正在尝试渲染以下组件:Reactjs 通过reactify在JSX中没有类,reactjs,Reactjs,我正在尝试渲染以下组件: function deviceready() { ReactDOM.render( <div class="container"> <h1>Hello <small>World</small></h1> <button class="button-primary" onclick="initFacebook()">Login with Facebook</b
function deviceready() {
ReactDOM.render(
<div class="container">
<h1>Hello <small>World</small></h1>
<button class="button-primary" onclick="initFacebook()">Login with Facebook</button>
</div>,
document.getElementById('frame')
);
}
函数devicerady(){
ReactDOM.render(
你好,世界
使用Facebook登录
,
document.getElementById('frame')
);
}
…使用reactify
gulp
插件。但是,属性不会被编译class=“container”
和class=“button primary
”和onclick=“initFacebook()”
不会出现在我生成的HTML中
我知道,但这些是HTML规范定义的属性。知道我做错了什么吗?注意Facebook文章中指出的差异
class
应该是className
还要注意;道具名称与HTML属性名称不完全匹配
onclick
应该是onclick
Ahh;有很多的FM-to-RT,前8分钟我是不被允许的!