javascript - Putting React templates in properties of one global variable -


is possible store react templates in properties of 1 global variable? mean want create 2 child templates:

app.templates.commonproducts = react.createclass(/* render, etc */); 

and

app.templates.discountproducts = react.createclass(/* render, etc */); 

how can these templates in "parent" template? tag names (commonproducts, discountproducts) should like?

app.templates.products = react.createclass({     render: function() {         return (             <div>                 <commonproducts></commonproducts>                 <discountproducts></discountproducts>             </div>         );     } }); 

it called namespaced components,

app.templates.products = react.createclass({   render: function() {     return (       <div>         <app.templates.discountproducts></app.templates.discountproducts>         <app.templates.commonproducts></app.templates.commonproducts>       </div>     );   } }); 

example


Comments