react-on-screen
react-on-screen copied to clipboard
Add onVisible event
Another use case I came across is triggering additional logic when the component becomes visible (outside of rendering logic). Would be super convenient to add an event as a prop such as onVisible
or onVisibilityChange
.
+1 This would be handy indeed
This would be useful.
Workaround (about to implement it) - Passing down a prop with the function to the component, which can be called onMount (or on render or whatever).
I'll see how I go and post an example here if it works.
#39