(prevProps)
| 129 | } |
| 130 | |
| 131 | componentDidUpdate(prevProps) { |
| 132 | // Viewport scroll is no longer useful if axis changes |
| 133 | if (this.props.axis !== prevProps.axis) this.clearSizeCache(); |
| 134 | |
| 135 | // If the list has reached an unstable state, prevent an infinite loop. |
| 136 | if (this.unstable) return; |
| 137 | |
| 138 | if (++this.updateCounter > MAX_SYNC_UPDATES) { |
| 139 | this.unstable = true; |
| 140 | return console.error(UNSTABLE_MESSAGE); |
| 141 | } |
| 142 | |
| 143 | if (!this.updateCounterTimeoutId) { |
| 144 | this.updateCounterTimeoutId = setTimeout(() => { |
| 145 | this.updateCounter = 0; |
| 146 | delete this.updateCounterTimeoutId; |
| 147 | }, 0); |
| 148 | } |
| 149 | |
| 150 | this.updateFrame(); |
| 151 | } |
| 152 | |
| 153 | maybeSetState(b, cb) { |
| 154 | if (isEqualSubset(this.state, b)) return cb(); |
no test coverage detected