gpt4 book ai didi

javascript - 为什么我的 react html 渲染不起作用?

转载 作者:搜寻专家 更新时间:2023-11-01 04:45:53 26 4
gpt4 key购买 nike

<分区>

我写了一个简单的 React 组件,但它没有在页面上呈现 HTML。有人可以指导我哪里做错了吗?

http://codepen.io/NehhaSharma/pen/EVNdJJ?editors=101

谢谢。

<div id="content"></div>
<script type="text/jsx">

var newComponent = React.createClass({
render : function(){
return (
<h2>My Name is React</h2>
);
}

});

React.render(<newComponent/>,document.getElementById('content'));
</script>

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com