一个非常初学和愚蠢的问题,但是,每个人一开始都会学习......
HTML
<div class="container" id="container">
CSS(SCSS)
$back:#1D1F20;
$font:'Open Sans',sans serif;
body{
background-color:$back;
padding:20px;
h1{
font-family:$font;
color:white;
}
DisplayBox{
font-family:$font;
color:white;
}
}
JS(Babel)
var DisplayBox=React.createClass({
render:function(){
return (
<h1>Marked</h1>
);
}
});
React.render(<DisplayBox />,document.getElementById("container"));
我的目标是在#container中呈现自定义标签DisplayBox,但它不在codepen.io中呈现 JS config in Codepen CSS config
提前感谢您的帮助: - )
答案 0 :(得分:1)
而不是
React.render(<DisplayBox />,document.getElementById("container"));
使用
ReactDOM.render(<DisplayBox />,document.getElementById("container"));
检查工作example