Changelog

2.0.5

2.0.4

2.0.3

2.0.2

2.0.1

2.0.0

Major internal rewrite. API has stayed identical though.

1.0.2

1.0.1

1.0.0

0.9.3

0.9.2

0.9.1

0.9.0

0.8.0

0.7.8

0.7.7

0.7.6

0.7.5

0.7.4

0.7.3

0.7.2

0.7.1

0.7.0

Introducing the offsetTop and offsetBottom props.

The offset prop is deprecated. Please use offsetTop which has the exact same semantics. offset will be removed in v0.8.

0.6.0

Another internal rewrite.

Since position: sticky now is widely supported, React Sticky Box is based on this property. The main motivation is that all workarounds have been shown to be flawed in performance-heavy applications.

Browsers with no sticky support will fallback to a position: "relative" behaviour which in my opinion is much preferrable to the half-broken situation before for older browsers. You still might want to check out the 0.5 branch in case you need to support stickyness in IE and Edge <= 15.

Another benefit of the new approach: you don’t need to specify the width anymore. Any StickyBox will be part of the layout flow like any other position: "relative" element would as well.

Performance was another priority. The scroll-handler now contains zero DOM-reads (except for getting the scroll position). Any container or content resize will be detected and handled separately via the resize-observer-polyfill.

0.5.0

completely rewritten the engine - using position: fixed and position: absolute. This will lead to almost no jank.

This change causes some new limitations:

Background: browser started more and more to not reliably fire the onScroll and onMouseWheel event since their engines started moving scrolling to some async thread for performance reasons. This meant that a lot of scrolling could happen without react-sticky-box getting notified.

By using position:fixed and switching to position:absolute when certain scroll boundaries are reached, there’s no more jank while scrolling. In the worst case a jump will happen when reaching one of these boundaries. But that’s much better than jumping almost every frame when scrolling!