0.0.3 • Published 6 years ago
@trbl/react-scroll-position v0.0.3
React Scroll Position
A roll, as of parchment or papyrus, used especially in the writing of a document.
Quick Start
Installation
$ yarn add @trbl/react-scroll-position
Compositon
import React from 'react';
import { ScrollPositionProvider, withScrollPosition } from '@trbl/react-scroll-position';
const MyComponent = withScrollPosition(() => return <div>My Component</div>);
const App = () => {
return (
<ScrollPositionProvider>
<MyComponent>
...
</MyComponent>
</ScrollPositionProvider>
)
}
export default App;
Demo
To demo locally, clone the repo and
$ yarn install
$ npm run dev
$ open http://localhost:3000
Documentation
All available props can be found via the references below:
License
MIT Copyright (c) TRBL, LLC