mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-26 18:23:41 +01:00
Use strict equality rather than Immutable.is as the compared props are values
This commit is contained in:
parent
82a76f03a4
commit
c49f7d5d16
1 changed files with 1 additions and 3 deletions
|
@ -1,9 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
|
||||||
import scheduleIdleTask from 'flavours/glitch/util/schedule_idle_task';
|
import scheduleIdleTask from 'flavours/glitch/util/schedule_idle_task';
|
||||||
import getRectFromEntry from 'flavours/glitch/util/get_rect_from_entry';
|
import getRectFromEntry from 'flavours/glitch/util/get_rect_from_entry';
|
||||||
import { is } from 'immutable';
|
|
||||||
|
|
||||||
// Diff these props in the "unrendered" state
|
// Diff these props in the "unrendered" state
|
||||||
const updateOnPropsForUnrendered = ['id', 'index', 'listLength', 'cachedHeight'];
|
const updateOnPropsForUnrendered = ['id', 'index', 'listLength', 'cachedHeight'];
|
||||||
|
@ -34,7 +32,7 @@ export default class IntersectionObserverArticle extends React.Component {
|
||||||
}
|
}
|
||||||
// If we are and remain hidden, diff based on props
|
// If we are and remain hidden, diff based on props
|
||||||
if (isUnrendered) {
|
if (isUnrendered) {
|
||||||
return !updateOnPropsForUnrendered.every(prop => is(nextProps[prop], this.props[prop]));
|
return !updateOnPropsForUnrendered.every(prop => nextProps[prop] === this.props[prop]);
|
||||||
}
|
}
|
||||||
// Else, assume the children have changed
|
// Else, assume the children have changed
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue