可能是一个非常初学者和愚蠢的问题,但每个人一开始都会学习..
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(通天塔)
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
提前感谢您的帮助:-)
最佳答案
代替
React.render(<DisplayBox />,document.getElementById("container"));
使用
ReactDOM.render(<DisplayBox />,document.getElementById("container"));
检查工作example
关于javascript - 在 Codepen.io 上使用 React.js,为什么自定义标签不呈现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43360934/