General react performance improvements (#2796)
* General React performance improvements * Cleaned up unused props/state in PermaLinkView and PostFocusView
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
9961ccca7d
Коммит
1f4974dc02
@@ -22,6 +22,25 @@ export default class UserProfile extends React.Component {
|
||||
super(props);
|
||||
this.uniqueId = nextId();
|
||||
}
|
||||
shouldComponentUpdate(nextProps) {
|
||||
if (!Utils.areObjectsEqual(nextProps.user, this.props.user)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (nextProps.overwriteName !== this.props.overwriteName) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (nextProps.overwriteImage !== this.props.overwriteImage) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (nextProps.disablePopover !== this.props.disablePopover) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
render() {
|
||||
let name = '...';
|
||||
let email = '';
|
||||
|
||||
Ссылка в новой задаче
Block a user