Comments (1)
I have the same problem as yours, to cover the argument inside useScrollPosition, you need to configure a mock by implementing a jest function, like that:
jest.mock('@n8tb1t/use-scroll-position', () => ({
...jest.requireActual('@n8tb1t/use-scroll-position'),
useScrollPosition: jest.fn()
.mockImplementationOnce((cb) => cb({ currPos: { y: 200 } })),
}));
from use-scroll-position.
Related Issues (20)
- Can't get it to work HOT 3
- How to make it work with an inner container that has overflow auto? HOT 16
- Doesn't account for overscroll HOT 1
- Scroll bounce on iphone HOT 1
- `getBoundingClientRect` is called even when `useWindow: true` HOT 1
- Scroll position as soon as the page loads HOT 1
- Scroll on bottom HOT 3
- Make listener passive HOT 2
- Build error with Next.js when using this library HOT 4
- IE 11 Syntax error HOT 1
- Type 'undefined' is not assignable to type 'HTMLElement' HOT 1
- useScrollPosition.defaultProps does nothing HOT 1
- NPM package doesn't install typings
- Old eventlisteners should be removed when the dependencies change.
- Hooks not called in overflowY: 'scroll' components HOT 1
- useScrollPosition does not work
- detect scroll stop
- any examples with the bouding element property being used?
- Argument of type 'MutableRefObject<HTMLElement | null>' is not assignable to parameter of type 'MutableRefObject<HTMLElement | undefined>'. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from use-scroll-position.