如何将字符串数据转换为JSX?

时间:2016-01-14 02:53:38

标签: reactjs react-jsx

我想获取远程数据,这个数据是JSX模板。我想使用这些数据动态渲染html。

my code

1 个答案:

答案 0 :(得分:0)

var Input = require('./components/input.jsx')
var Button = require('./components/Button.jsx')
var Panel = require('./components/panel.jsx')
var Container = require('./components/container.jsx')
var Styles = require('./components/styles.jsx')
var Style = require('./components/style.jsx')

var LoadData = require('./lib/LoadData');

LoadData.load('life_nearby_food', function(string){
    // string may be link "<Container><Layout orientation="vertical" width="fill" height="wrap">...</Layout></Container>" etc
    var app = React.createClass({
        render: function() {
            return string;
        }
     });
 });