-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Unable to resolve types reexported from react-onclickoutside
#4974
Comments
Hopefully soon that prop is going to be removed |
I don't know, it's related or no, but I got that error on build with new one below
|
I can't build my UI lib that depends on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Types reexported from
react-onclickoutside
cannot be used unless@types/react-onclickoutside
is installed as well asreact-datepicker
.This means that
excludeScrollbar
is not correctly typed as aboolean
, and TypeScript does not cleanly compile unless theskipLibCheck
compiler option istrue
.TypeScript fails with:
To Reproduce
See CodeSandbox; direct link to index.d.ts.
Expected behavior
excludeScrollbar
is a booleanScreenshots
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context
I think the simplest fix here is to add
@types/react-onclickoutside
as a dependency rather than dev dependency.An alternative fix is to redefine the types from
@types/react-onclickoutside
inline without importing them fromreact-onclickoutside
.Two workarounds are:
skipLibCheck
TypeScript compiler options – this allows TypeScript to compile but does not correct the type ofexcludeScrollbar
.npm install --save-dev @types/react-onclickoutside
to include the missing types.The text was updated successfully, but these errors were encountered: