You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the current state is visible and the next one is also visible then why should i update the component?
i would think that the wanted behavior should be:
The text was updated successfully, but these errors were encountered:
MatanBobi
changed the title
shouldComponentUpdate returns true when the image is visible
shouldComponentUpdate returns true when the item is visible
Jun 7, 2017
I'm inclined to agree. It isn't quite as simple as !this.state.visible && nextState.visible since props could have changed including props.children aka whatever is being lazy loaded. Adding a shallow equal of the props should work since all the props are primitives except props.children, leaving it up to the developer using the package to put in a component that will only cause the update when necessary.
Hey there!
Im trying to understand whats the reason for the shouldcomponentupdate logic that you are applying.
If the current state is visible and the next one is also visible then why should i update the component?
i would think that the wanted behavior should be:
What am i missing here?
Thanks!
The text was updated successfully, but these errors were encountered: