fkhadra / react-on-screen

Check if a react component in the viewport
https://fkhadra.github.io/react-on-screen/
MIT License
405 stars 50 forks source link

Child components do not update #9

Closed matekb closed 6 years ago

matekb commented 6 years ago

I have the following use case:

<TrackVisibility once={true}>
       <MyComponent {...someProps} />
</TrackVisibility>

Since 2.0.0 this is not working anymore since MyComponent never gets updated even when someProps change. The reason for this, I think, might be that shouldComponentUpdate has been introduced into TrackVisibility which only let the child components update if isVisible has changed.

fkhadra commented 6 years ago

@matekb you're right. Fix on the way

fkhadra commented 6 years ago

@matekb fix released. Thank you !

matekb commented 6 years ago

That was quick. Thanks :)