Search code examples
htmlreactjsweb-component

Use react components in html as html tags


I have a simple react component defined as follows

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>

I want to be able to use this component in html by simply typing <MyComp></MyComp> instead of using React.render(); Is this possible?


Solution

  • I found that this does it - https://github.com/PixelsCommander/ReactiveElements perfectly well