-
-
Notifications
You must be signed in to change notification settings - Fork 980
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
Certain classes (ScrollView, RNGHTextInput) no longer exporting type #2889
Comments
Hey! 👋 The issue doesn't seem to contain a minimal reproduction. Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem? |
It seems to have been broken from: #2835 |
I also reported this on Discord, but I'll add following: Hey folks, RNGH 2.16.1 is breaking types. actually problem is that gesture handler has moved the typings to .native.d.ts file in 2.16.1 and our setup now only looks for .d.ts. interestingly when i added it to moduleSuffixes, our modules on web started picking .native.tsx. We had to downgrade back to 2.16.0 - we'd appreciate a fix or rollback |
Hi @johnnywang! We decided to revert faulty PR (#2896). I'll make sure to let you know when we release patched version. |
) ## Description This reverts commit e3e0b79. #2835 was the first PR that was meant to introduce compatibility with `Next.js`. Unfortunately, it broke types outside of our repository. Our `tsconfig.json` has special flag, i.e. `moduleSuffixes`, which allows `tsc` to look for `.native` files first. Most of our users do not have this flag and they've run into `ts` problems, like this one: ``` 'TextInput' refers to a value, but is being used as a type here. Did you mean 'typeof TextInput'? ``` Given that removing `moduleSuffixes` from `tsconfig` results in a bunch of errors (and there are more of them that we may not be aware of), we decided that it will be better to revert this change for now. It is not necessary since we only need it to support `Next.js`. At first I thought that #2873 may help, but unfortunately it doesn't. Fixes #2889 ## Test plan 1. Check that web, Android and iOS work as they did before 2. Check that code from [this comment](#2835 (comment)) now does not throw any errors
We've just released 2.16.2 😄 It would be great if you could confirm that the errors are gone after upgrading to the newest version! |
I can confirm this has been fixed in 2.16.2, I no longer have TS errors |
Description
After updating to 2.16.1, I'm getting TypeScript errors in my code from several packages exported by RNGH when used in refs. Namely,
ScrollView
andRNGHTextInput
will now error out with something like'ScrollViewType' refers to a value, but is being used as a type here. Did you mean 'typeof ScrollViewType'?
Looking online, it seems this results from the type not being exported anymore, with some suggestions being to use
InstanceType<typeof ScrollView>
in place of it, but that only seems to throw different errors.Opening as a bug because I didn't see any notes in the changelog about breaking changes, so this doesn't seem intentional.
Steps to reproduce
ScrollView
orRNGHTextInput
inside something like auseRef
Snack or a link to a repository
n/a
Gesture Handler version
2.16.1
React Native version
0.72.10
Platforms
Android, iOS
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: