ammarahm-ed / react-native-actions-sheet

A Cross Platform(Android, iOS & Web) ActionSheet with a flexible api, native performance and zero dependency code for react native. Create anything you want inside ActionSheet.
https://rnas.vercel.app
MIT License
1.49k stars 121 forks source link

Doesn't work in screen presentation modal. #293

Closed isilgawen closed 8 months ago

isilgawen commented 1 year ago

Hello, I try to use the SheetManager inside a Screen View with modal presentation. Like this :

<Stack.Group screenOptions={{ presentation: 'modal'}} >
          <Stack.Screen name="MyComponent" component={MyComponent} options={{ headerShown: false }} />
</Stack.Group>

In MyComponent, SheetManager.show doesn't work but no error. With normal Screen without presentation: modal it works, but it's not what i want.

Any idea or workaround ? thanks for your help.

johnny-mcfadden-dailypay commented 1 year ago

Same issue as https://github.com/ammarahm-ed/react-native-actions-sheet/issues/296 this issue can be closed and use linked one for discussion.

But in short: You need to register the sheets under a new context for a modal and add a sheet provider. https://rnas.vercel.app/reference/sheetprovider