I was trying out the custom extensions from README:
var sparkScroll = require('react-spark-scroll/spark-scroll-rekapi')({
invalidateAutomatically: true
formulas: {
//similar to the built-in topBottom formula, except that offset
// is calculated as a percentage of the viewport height
topBottomPct: (element, container, rect, containerRect, offset) =>
~~(rect.bottom - containerRect.top + offset*containerRect.clientHeight/100)
}
});
In my testing, the containerRect does not have clientHeight attribute. It should be rather height. Please confirm, and if so, update the Docs. Thanks!
p.s. Also cannot resolve require('react-spark-scroll/spark-scroll-rekapi') in webpack. Used require('react-spark-scroll-rekapi') instead.
I was trying out the custom extensions from README:
In my testing, the
containerRect
does not haveclientHeight
attribute. It should be ratherheight
. Please confirm, and if so, update the Docs. Thanks!p.s. Also cannot resolve
require('react-spark-scroll/spark-scroll-rekapi')
in webpack. Usedrequire('react-spark-scroll-rekapi')
instead.