Skip to content

Instantly share code, notes, and snippets.

@andyshora
Created April 9, 2018 10:24
Show Gist options
  • Save andyshora/a7f339ca01906dcd4270bbbd719ee066 to your computer and use it in GitHub Desktop.
Save andyshora/a7f339ca01906dcd4270bbbd719ee066 to your computer and use it in GitHub Desktop.
Qadre Technical Test - React - PUBLIC
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