mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-26 07:42:49 +00:00
Fixed: Conditional Rendering on Page Jump Bar
Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
parent
cf1210a7f9
commit
5e3a0e2cd7
1 changed files with 10 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
import _ from 'lodash';
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { PureComponent } from 'react';
|
||||
import React, { Component } from 'react';
|
||||
import dimensions from 'Styles/Variables/dimensions';
|
||||
import Measure from 'Components/Measure';
|
||||
import PageJumpBarItem from './PageJumpBarItem';
|
||||
|
@ -8,7 +8,7 @@ import styles from './PageJumpBar.css';
|
|||
|
||||
const ITEM_HEIGHT = parseInt(dimensions.jumpBarItemHeight);
|
||||
|
||||
class PageJumpBar extends PureComponent {
|
||||
class PageJumpBar extends Component {
|
||||
|
||||
//
|
||||
// Lifecycle
|
||||
|
@ -26,6 +26,14 @@ class PageJumpBar extends PureComponent {
|
|||
this.computeVisibleItems();
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
return (
|
||||
nextProps.items !== this.props.items ||
|
||||
nextState.height !== this.state.height ||
|
||||
nextState.visibleItems !== this.state.visibleItems
|
||||
);
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
if (
|
||||
prevProps.items !== this.props.items ||
|
||||
|
|
Loading…
Reference in a new issue