1.我是新的反應,我不明白這個代碼有什麼問題。我看不到任何這個反應代碼的輸出
2.我有HTML文件,我已經添加了一個ID爲「container」的div。
var HelloWorld = React.createClass({
render: function() {
return (
<div>
{this.props.children}
</div>
);
}
});
ReactDOM.render(
<div>
<HelloWorld>A</HelloWorld>
<HelloWorld>B</HelloWorld>
</div>,
document.getElementById("container")
);
檢查控制檯,你得到的任何錯誤訊息?你能顯示你使用這個代碼的完整的html文件嗎? –
這段代碼沒有錯。 – abdul
目前我正在使用codepen.io在線編輯器。 – user7455856