client/components/Users/UserInfoField.jsx
import React, { PropTypes, Component } from 'react';
import './UserInfoField.styles.css';
export default class UserInfoField extends Component {
static propTypes = {
title: PropTypes.string.isRequired
}
shouldComponentUpdate(nextProps) {
return nextProps.title !== this.props.title || nextProps.children !== this.props.children;
}
render() {
const { title, children } = this.props;
return (
<div className="user-info-field">
<div className="user-info-field-title">{title}</div>
<span>{children}</span>
</div>
);
}
}