import React from 'react' import PropTypes from 'prop-types' export default class Message extends React.Component { render() { const msg = this.props.data; return (
{`${msg.user.uname}`}

{msg.body}

{ msg.photo &&

}
)} }; function Tags(props) { return props.data && props.data.map(tag => { return ({ tag }) }) } Message.propTypes = { msg: PropTypes.shape({ mid: PropTypes.number.isRequired, user: PropTypes.shape({ uid: PropTypes.number.isRequired, uname: PropTypes.string.isRequired }), timestamp: PropTypes.string.isRequired, body: PropTypes.string }) }