javascript - How can I combine child nodes with JSX? -


i want build ul list li elements, li elements come different sources, can't in 1 statement. appears jsx can't handle set of child elements, gives me syntax error:

var items = <li>s</li>   <li>s</li>   <li>s</li>; 

ideally want like:

var items1 = <li>s</li>   <li>s</li>   <li>s</li>; var items2 = <li>s</li>   <li>s</li>   <li>s</li>; var list = <ul>{items1}{items2}</ul>; 

is there way achieve this?

jsx desugars straightforwardly javascript syntax can mix freely.

/** @jsx react.dom */ var items1 = [ <li>s</li>,            var items1 = [ react.dom.li({}, "s"),                <li>s</li>,                           react.dom.li({}, "s"),                <li>s</li> ];                         react.dom.li({}, "s") ]; var items2 = [ <li>s</li>,            var items2 = [ react.dom.li({}, "s"),                <li>s</li>,                           react.dom.li({}, "s"),                <li>s</li> ];                         react.dom.li({}, "s") ]; var list = <ul>{items1+items2}</ul>;  var list = react.dom.ul({}, items1+items2); 

Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -