mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
fix lifecycle
This commit is contained in:
parent
d47df34ed1
commit
26c261f3e7
@ -21,7 +21,7 @@ const NoResultComponent = () => {
|
||||
}
|
||||
|
||||
// FIXME: Scroll behavior should scroll to next post or the previous one depending on the direction of the scroll
|
||||
export default class PostsFeed extends React.PureComponent {
|
||||
export default class PostsFeed extends React.Component {
|
||||
state = {
|
||||
initialLoading: true,
|
||||
fetchingData: true,
|
||||
@ -80,6 +80,11 @@ export default class PostsFeed extends React.PureComponent {
|
||||
window.app.shortcuts.remove("postsFeed.scrollDown")
|
||||
}
|
||||
|
||||
// avoid to re-render the whole list when props change
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
return this.state !== nextState
|
||||
}
|
||||
|
||||
scrollUp = () => {
|
||||
this.scrollToIndex(this.state.currentIndex - 1)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user