lodev09 / react-native-true-sheet

The true native bottom sheet experience 💩
https://sheet.lodev09.com
MIT License
395 stars 12 forks source link

[iOS]: Attempt to present sheet on top of an existing sheet #5

Closed KirillCustom closed 5 months ago

KirillCustom commented 5 months ago

On iOS, when you try to open a sheet on top of an existing sheet, an error appears in the console:

Attempt to present <TrueSheet.TrueSheetViewController: 0x11829f800> on <UIViewController: 0x10900eb10> (from <RNSScreen: 0x117dbf400>) which is already presenting <TrueSheet.TrueSheetViewController: 0x11a0b9200>.

Does this library support multiple sheets, as in Android?

lodev09 commented 5 months ago

@KirillCustom define the sheet within the parent sheet. Or dismiss the presented sheet first before opening another one. The former has better UX imo.

<TrueSheet>
  <Button onPress={() => sheet2.current?.present()}
  <TrueSheet ref={sheet2}>
    // ...
  </TrueSheet>
</TrueSheet>

Example: 2024-04-19 21 52 06