joshwnj / react-visibility-sensor

Sensor component for React that notifies you when it goes in or out of the window viewport.
MIT License
2.32k stars 195 forks source link

Rewrite visibility sensor to hooks #161

Open sergio-toro opened 5 years ago

sergio-toro commented 5 years ago

This PR:

Missing:

@joshwnj What do you think? It will be more powerful API than adding a custom way of passing ref up from VisibilitySensor.

jedwards1211 commented 5 years ago

https://github.com/roderickhsiao/react-in-viewport already has a hook-based API. Maybe just add a link to it in docs?

ghost commented 4 years ago

Anyone know where this ended up? I was looking at this PR and the other one linking to and it seems like they're both sitting on the back burner. Would love to get rid of those deprecation warnings... :)

sergio-toro commented 4 years ago

Hi @josectello it's only missing the approval from @joshwnj and a couple missing tests. Right now I don't have time to do the tests as I've started managing a project for the first time and it's been challenging.

Would be really helpful if you have time to review the tests, I can ask Josh to review after and push for a new release.