我们如何动态创建反应类?

时间:2016-09-26 12:22:57

标签: class reactjs dynamic

是否有任何可行的方法来循环遍历下面的类而不是逐个进行。像罐头一样,A,B,C的映射方式使得它们返回如下相同的语句......?

//individual similar classes 
var A = React.createClass({ ... });
var B = React.createClass({ ... });
var C = React.createClass({ ... });
var D = React.createClass({ ... });

//class that executes all these classes through map and return something along these lines    
[A,B,C,D] => [React.createClass({ ... }),React.createClass({ ... }),React.createClass({ ... }),React.createClass({ ... })]

0 个答案:

没有答案