reactjs - Looping in JSX files -


i trying render dynamic list of elements using react, i.e. have javascript array elems = ['foo','bar'] , generate

<ul>   <li>foo</li>   <li>bar</li> </ul> 

i purely in jsx. there convenient way (an "equivalent" of angular ng-repeat)?

the beauty of react/jsx write javascript. if have list of things , want create list of components, map list:

<ul>   {items.map(item => <li>{item}</li>)} </ul> 

(and it's concise arrow functions)


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -