Closed johnnywang closed 6 months ago
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: https://github.com/software-mansion/react-native-gesture-handler/pull/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.
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