]> cat aescling's git repositories - mastodon.git/commitdiff
Use strict equality rather than Immutable.is as the compared props are values
authorThibaut Girka <thib@sitedethib.com>
Mon, 1 Jul 2019 10:45:18 +0000 (12:45 +0200)
committerThibG <thib@sitedethib.com>
Mon, 1 Jul 2019 17:31:10 +0000 (19:31 +0200)
app/javascript/flavours/glitch/components/intersection_observer_article.js

index c8427f0bf6ba6d8fd88946e4a8963423c937f5bf..03b3700df4c9d31840358f417c9c3446e77d4796 100644 (file)
@@ -1,9 +1,7 @@
 import React from 'react';
 import PropTypes from 'prop-types';
-import ImmutablePureComponent from 'react-immutable-pure-component';
 import scheduleIdleTask from 'flavours/glitch/util/schedule_idle_task';
 import getRectFromEntry from 'flavours/glitch/util/get_rect_from_entry';
-import { is } from 'immutable';
 
 // Diff these props in the "unrendered" state
 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 (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
     return true;