Skip to content

Releases: thebuilder/react-intersection-observer

v8.28.6

24 Sep 08:04
b3e2959
Compare
Choose a tag to compare

8.28.6 (2020-09-24)

Bug Fixes

v8.28.5

11 Sep 20:52
Compare
Choose a tag to compare

8.28.5 (2020-09-11)

Bug Fixes

  • Detect inView if threshold is 1, closes #387

v8.28.4

10 Sep 08:25
53024af
Compare
Choose a tag to compare

8.28.4 (2020-09-10)

Bug Fixes

v8.28.3

09 Sep 14:09
0252048
Compare
Choose a tag to compare

8.28.3 (2020-09-09)

Bug Fixes

  • check intersectionRatio in addition to isIntersecting (#384) (0252048)

v8.28.2

08 Sep 07:52
9de54b7
Compare
Choose a tag to compare

8.28.2 (2020-09-08)

Bug Fixes

v8.28.1

07 Sep 12:21
Compare
Choose a tag to compare

8.28.1 (2020-09-07)

Bug Fixes

  • There was an issue with the CJS and UMD files generated by microbundle, not matching filename in package.json

v8.28.0

07 Sep 11:55
1537592
Compare
Choose a tag to compare

8.28.0 (2020-09-07)

Features

Details

This is a rewrite of the internal handling of IntersectionObservers, alongside general refactoring and alignment of the code.

  • Breaking change: Remove default export for the InView component
  • Remove outdated fixes for the initial IntersectionObserver browser implementation. These were needed 3 years ago, to ensure all browsers acted according to the spec
  • Support multiple observers on the same element. Closes #340
  • Rewrite tests, so they use test-utils to properly mock the IntersectionObserver instances
  • Switch to microbundle for compiling
  • Add initial IntersectionObserver v2 support. Closes #368

IntersectionObserver v2 🧪

The new
v2 implementation of IntersectionObserver
extends the original API, so you can track if the element is covered by another
element or has filters applied to it. Useful for blocking clickjacking attempts
or tracking ad exposure.

To use it, you'll need to add the new trackVisibility and delay options.
When you get the entry back, you can then monitor if isVisible is true.

const TrackVisible = () => {
  const { ref, entry } = useInView({ trackVisibility: true, delay: 100 });
  return <div ref={ref}>{entry?.isVisible}</div>;
};

This is still a very new addition, so check
caniuse for current browser
support. If trackVisibility has been set, and the current browser doesn't
support it, a fallback has been added to always report isVisible as true.

It's not added to the TypeScript lib.d.ts file yet, so you will also have to
extend the IntersectionObserverEntry with the isVisible boolean.

v8.28.0-beta.2

01 Sep 09:50
Compare
Choose a tag to compare
v8.28.0-beta.2 Pre-release
Pre-release

8.28.0-beta.2 (2020-09-01)

Features

  • add initial support for IntersectionObserver v2 (9d53139)

v8.28.0-beta.1

30 Aug 21:56
Compare
Choose a tag to compare
v8.28.0-beta.1 Pre-release
Pre-release

8.28.0-beta.1 (2020-08-30)

Features

  • rewrite internals and tests (4b0d1a7)

v8.27.1

20 Aug 19:13
7aa5d74
Compare
Choose a tag to compare

8.27.1 (2020-08-20)

Bug Fixes

  • shouldn't trigger onchange when skipping (#365) (7aa5d74)