Skip to content

useScrollWatcher Update

Latest
Compare
Choose a tag to compare
@zJaaal zJaaal released this 18 Jan 18:12
f2bae61

Summary

This update adds the hook useScrollWatcher and its compatibility in all the library. Also, minor improvements in the internal calculations and some bug fixes.

useScrollWatcher

This hook let you create an scroll context to use it as an scroll reference for all the hooks and components in the library. It just need a reference to an element that has an scroll behavior.

Linear Value Options

Now has another property called "context", this property accepts the object returned by useScrollWatcher and it will use this context instead of the regular context created by ScrollWatcher component.

Remember that most hooks use this options as an optional parameter.

Circle & Rectangle Component

Now both components accept Linear Value Options on "options" prop.

useDirection & useProximity Hooks

Now both hooks accepts "context" as an optional parameter and it should be an scroll context created with useScrollWatcher.

useLinearValue

Fixed a bug were you couldn't use an startValue bigger than a endValue. This was a fail in my logic during implementation.