Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Given the example React solution from your post:
- ```jsx
- var createItem = function(itemText) {
- return <li>{itemText}</li>;
- };
- return <ul>{this.props.items.map(createItem)}</ul>;
- ```
- I'd actually write that loop in React like this (and skip React Templates altogether):
- ```jsx
- return (
- <ul>
- {this.props.items.map(item => (
- <li>{item}</li>
- )}
- </ul>
- );
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement