Skip to content
React Intersection Observer
Esc
↑↓navigate↵open⌘Jpreview
On this page

TypeScript edition! 🎉

I decided to switch the project from Flow to TypeScript. This should ensure the TypeScript definitions match the actual implementation, without the need to manually sync the index.d.tsfile.

In the process, i’ve rewritten some of the internals, but it shouldn’t affect the actual API.

A documentation site has also been created using docz: https://react-intersection-observer.now.sh

Breaking changes

  • The deprecated render method has been removed - Make sure you use children instead.
  • Instead of returning just intersectionRatio, you now get entry that contains the entire IntersectionObserverEntry element. If you’re relying on intersectionRatio, you should change your code to entry.intersectionRatio.
  • rootId has been removed - An idea for each unique root is now auto generated. This always felt like temporary solution, until i implemented a smarter way.
  • Flow types have been removed.

Last updated on January 30, 2019

Was this page helpful?