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
Invalid hook call when using it inside a library #256
Comments
Sorry, image with generic stack trace is not debuggable. |
I understand, not sure this will be helpful but here is the full log from console:
the component from our lib
how we're using it in the project
I can't give you a codesandbox for example because the error only happens locally when we connect the library into the project using |
useEffect(() => {
if (visible) {
document.body.style.overflow = 'hidden'
document.addEventListener('keydown', onKeyDown, false);
+ return () => document.removeEventListener('keydown', onKeyDown, false);
} else {
document.body.style.overflow = 'unset'
}
}, [visible])
How moment related to the focus-lock:
There are multiple ways to resolve the issue, follow the linked issue. |
Hello!
The project I work on has its own npm package with our design system's components.
We use FocusLock on two different components but for some reason, when we import these components into the project, we get this error on screen:
the error only occurs when we use npm link <lib_name> to test the lib local
The text was updated successfully, but these errors were encountered: