我有一个简单的 react 组件,定义如下
var MyComp = React.createClass({
render: function() {
return (
<div>This is a new component</div>
);
}
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react.js"></script>
我希望能够通过简单地输入 <MyComp></MyComp>
在 html 中使用此组件而不是使用React.render();
这可能吗?
最佳答案
我发现这样做了 - https://github.com/PixelsCommander/ReactiveElements非常好
关于html - 使用html中的react组件作为html标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31207664/