Last active
September 30, 2015 17:43
-
-
Save dstevensio/6e473b3eee3ea5cae37b to your computer and use it in GitHub Desktop.
Using map in JSX string literal return
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyComponent extends React.Component { | |
render() { | |
return ( | |
<ul> | |
{this.props.listItems.map((item) => { | |
return <li>{item}</li>; | |
})} | |
</ul> | |
); | |
} | |
} | |
// <MyComponent listItems={["one", "two", "three"]}/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment