Releases: thebuilder/react-intersection-observer
Releases · thebuilder/react-intersection-observer
Render Prop Pattern
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
Thanks to @Kovensky for correcting the definitions.
Added Typescript Definition
Thanks to @forabi
Going with the Flow
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
v0.3.0
v0.2.13
v0.2.12
Removed debugging console.log