@schibstedspain/sui-react-hooks
Advanced tools
Comparing version 1.9.0 to 1.10.0
@@ -5,2 +5,14 @@ # Change Log | ||
# 1.10.0 (2020-02-25) | ||
### Features | ||
* added useScroll hook ([413a529](https://github.com/SUI-Components/schibsted-spain-components/commit/413a52956fc2ef37bfdca1496c909d7fade0f141)) | ||
* applied the Pull Request suggestions ([de39585](https://github.com/SUI-Components/schibsted-spain-components/commit/de395850fcaeb71a23e5547875672604bc0ea816)) | ||
* improve and optimize the code ([aaf0ede](https://github.com/SUI-Components/schibsted-spain-components/commit/aaf0ede0d1497605afd2cc670eabe28adfb69095)) | ||
* removed unnecessary array argument ([daf7da0](https://github.com/SUI-Components/schibsted-spain-components/commit/daf7da0567b3a6139fbea39abe067f7ad4fe67b6)) | ||
# 1.9.0 (2020-02-24) | ||
@@ -7,0 +19,0 @@ |
@@ -12,2 +12,3 @@ export default function ReactHooks() { | ||
export { default as useOnScreen, useNearScreen } from './useOnScreen'; | ||
export { default as usePrevious } from './usePrevious'; | ||
export { default as usePrevious } from './usePrevious'; | ||
export { default as useScroll } from './useScroll'; |
{ | ||
"name": "@schibstedspain/sui-react-hooks", | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -157,2 +157,23 @@ # ReactHooks | ||
> **Find full description and more examples in the [demo page](#).** | ||
### useScroll | ||
Hook to get the scroll position and the direction of scroll, limited to the Y axis. | ||
The hook `useScroll` always returns an object with **position** and **direction of scroll** | ||
```js | ||
import {useScroll} from '@schibstedspain/sui-react-hooks' | ||
export default function Demo() { | ||
const {position, direction} = useScroll() | ||
return ( | ||
<> | ||
<p>{`Scroll position: ${position}`}</p> | ||
<p>{`Scroll direction: ${direction}`}</p> | ||
</> | ||
) | ||
} | ||
``` | ||
> **Find full description and more examples in the [demo page](#).** |
15753
11
196
179