Pass props from template into react.js root node

前端 未结 3 2057
日久生厌
日久生厌 2021-01-04 11:03

I may have missed something, but here goes. If I have:

var Swoosh = React.createClass({
  render: function() {
    ret         


        
3条回答
  •  误落风尘
    2021-01-04 11:38

    No, though of course you can do:

    var container = document.getElementById('content');
    React.renderComponent(
      ,
      container
    );
    

    (or if you want to make an attributes dict using something like https://stackoverflow.com/a/5282801/49485, then you can do Swoosh(attributes)).

提交回复
热议问题