Skip to content

Rework some internals

Choose a tag to compare

@thebuilder thebuilder released this 11 Mar 21:34

Potential breaking change #195

Change for the <InView>

Previously, the initial callback would trigger a state update, even if the element was still outside the viewport.
This update changes the behavior, so it won't trigger new state update before the element enters the viewport.

If you used the IntersectionObserverEntry during that first callback, it will no longer work. The use case for this, is most likely to determine if the element started outside the viewport.

Workaround

As a workaround, you can use the onChange callback, since this will still be called everytime.