Created
April 9, 2018 10:24
-
-
Save andyshora/a7f339ca01906dcd4270bbbd719ee066 to your computer and use it in GitHub Desktop.
Qadre Technical Test - React - PUBLIC
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
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
import _ from 'lodash'; | |
class List extends React.Component { | |
render() { | |
const { | |
name, | |
data | |
} = this.props; | |
const items = data.items; | |
return ( | |
<div> | |
<ul> | |
{_.map(data.items, (item, i) => { | |
return <li key={i}>{ item }</li> | |
})} | |
</ul> | |
</div> | |
); | |
} | |
} | |
List.propTypes = { | |
name: PropTypes.string, | |
data: PropTypes.any, | |
}; | |
List.defaultProps = { name: "My List" }; | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment