Skip to content

Releases: thebuilder/react-intersection-observer

Render Prop Pattern

21 Dec 14:52
Compare
Choose a tag to compare

The render prop pattern recently became a popular replacement for the child as function pattern.

Previously the render prop on react-intersection-observer, was handled differently from children so it only rendered when the element was inside the viewport.

⚠️ Breaking change

If you were using the render prop before, you need to handle when to render the content.

Old way

<Observer render={() => <div>Only rendered when in viewport</div>} />

New way

<Observer render={inView => inView ? <div>Only rendered when in viewport</div> : null} />

Updated Typescript definitions

14 Nov 08:50
Compare
Choose a tag to compare

Thanks to @Kovensky for correcting the definitions.

Added Typescript Definition

10 Nov 13:12
Compare
Choose a tag to compare

Going with the Flow

24 Oct 08:42
Compare
Choose a tag to compare

Switched to using Flow to type check all the code.
There shouldn't be any breaking changes, but there has been some internal bug fixes that was caught after enabling Flow.

v1.0.0

04 Aug 11:08
Compare
Choose a tag to compare

Added support for all the IntersectionObserver options! 🎉

This closes #18

v0.3.0

25 May 22:48
Compare
Choose a tag to compare

Removed the Intersection Observer polyfill - You need to add it manually to your project.

Fixes: #10

v0.2.13

24 May 15:55
Compare
Choose a tag to compare

Fix #8 - Merge usage of isIntersecting with intersectionRatio.

v0.2.12

24 May 13:21
Compare
Choose a tag to compare

Removed debugging console.log

v0.2.10

24 May 11:34
Compare
Choose a tag to compare

Fixes #7 by removing usage of isIntersecting