Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawer with snap points do not open when initial snap point isn't 0 #146

Closed
KajSzy opened this issue Oct 16, 2023 · 1 comment
Closed

Drawer with snap points do not open when initial snap point isn't 0 #146

KajSzy opened this issue Oct 16, 2023 · 1 comment

Comments

@KajSzy
Copy link
Contributor

KajSzy commented Oct 16, 2023

Codesandbox:
https://codesandbox.io/p/sandbox/drawer-snap-points-forked-hh78xy

I came to point where snapToPoint is called with drawerRef.current as undefined.
In provided sandbox there is commented out useEffect that triggers forced re-render.

Adding drawerRef.current as dependency instead of drawerRef is fixing but any useRef value as dependency is kinda anti-pattern.

@emilkowalski
Copy link
Owner

Fixed by @KajSzy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants