Skip to content

adds dismiss to CustomActionSheet#351

Open
mlisikbf wants to merge 1 commit intoexpo:masterfrom
mlisikbf:feat/dismiss-custom-action-sheet
Open

adds dismiss to CustomActionSheet#351
mlisikbf wants to merge 1 commit intoexpo:masterfrom
mlisikbf:feat/dismiss-custom-action-sheet

Conversation

@mlisikbf
Copy link

adds a dismiss method on CustomActionSheet so that the sheet can be programmatically dismissed, for instance:

const {showActionSheetWithOptions, dismiss} = useActionSheet()

// dismiss action sheet when screen unmounts
useEffect(() => {
  return () => {
     dismiss()
  }
}, [dismiss])

fixes #320
this also previously came up in #104

one use case is dismissing the action sheet on navigation, for instance:

  • user opens the sheet
  • they background the app
  • they come back
  • their session timed out
  • they're kicked out to the sign in screen
  • action sheet persists on top

or:

  • user opens the sheet
  • they background the app
  • they use a deep link
  • app opens and navigates
  • action sheet persists on top

NOTE: this is a noop on iOS at the moment as there's an old react-native / types dependency and updating that to a version that includes ActionSheetIOS.dismissActionSheet requires additional changes (breaks the build basically)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to close action sheet when redirected

1 participant