-
-
Notifications
You must be signed in to change notification settings - Fork 788
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
[Bug]: Incorrect type for present
in Bottom Sheet Modal methods
#2023
Comments
Found this issue because I had the same question! I was looking at the map app example code, and was curious how this worked with type |
If you don't want to wait for PR #2029, an alternative is to add a custom type to the project and use it as follows: type BottomSheetModalWithData<T = any> = Omit<BottomSheetModal, 'present'> & { present: (data?: T) => void } const alertModalPrimaryRef = useRef<BottomSheetModalWithData<AlertModalContentProps>>(null)
const handleUpdatePress = () => {
alertModalPrimaryRef.current?.present({
type: 'success',
test: true, // Throws error because `test` isn't defined in `AlertModalContentProps`
})
} |
I also have this issue |
it should be fixed in latest release , thanks to @maximpostnikov PR 🙌 |
Version
v5
Reanimated Version
v3
Gesture Handler Version
v2
Platforms
iOS, Android, Web
What happened?
According to the doc, the type should be
any
. But in this commitany
was changed tonever
everywhere.Types were not correctly resolved in the snack.
Reproduction steps
present
methodReproduction sample
https://snack.expo.dev/@dwnste/reproducing-issue
Relevant log output
No response
The text was updated successfully, but these errors were encountered: