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
rendermethod has been removed - Make sure you usechildreninstead. - Instead of returning just
intersectionRatio, you now getentrythat contains the entireIntersectionObserverEntryelement. If you're relying onintersectionRatio, you should change your code toentry.intersectionRatio. rootIdhas 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.