Closed Luxlorys closed 1 month ago
@Luxlorys can you paste your code here?
// Home.tsx
export const Home = () => {
<Box>
<Map />
<EventsBottomSheet />
<EventDetailsBottomSheet />
</Box>
// Map.tsx
export const Map = () => {
const handleMarkerClick = (marker: MarkerT) => SheetService.open('EVENT_DETAILS_SHEET', 0);
return (
<MapView
ref={mapRef}
showsCompass={false}
provider={PROVIDER_GOOGLE}
style={styles.flex1}
initialCamera={{ center: initialCamera, pitch: 1, heading: 1, zoom: 13 }}>
{markers.map((marker, index) => (
<Marker
key={marker.id}
marker={marker}
stopNumber={index + 1}
onPress={handleMarkerClick}
/>
))}
</MapView>
);
}
// EventsBottomSheet.tsx
export const EventsBottomSheet = () => {
const handleEventPress = () => SheetService.open('EVENT_DETAILS_SHEET', 0);
<TrueSheet
ref={sheet}
scrollRef={scrollRef}
dimmed={false}
cornerRadius={24}
name={SHEET_NAMES.EVENTS_SHEET}
sizes={[600]}>
// some code here for scrollview
<TouchableOpacity onPress={}>
<EventCard />
</ TouchableOpacity >
<EventDetailsBottomSheet />
</ TrueSheet>
Not all code but the logic is that i want to open
hmmm looks okay.. Can you create a reproducible example? You can use the example project in this repo -- it's also using maps and child sheets
sorry i can't the only solution i found is to put all my sheets to root screen (Home) and close parent sheet before open child one, but this solution isn't convenient for me
You need to close the presenting sheet first if it's not the parent of the sheet you're trying to present. That's how IOS works, unfortunately
that's the problem - i try to open new sheet which is child to EventsBottomSheet sheet and it works fine, it opens above parent as i wanted to but at the same time i want to open this sheet (child) from Home screen which is parent for EventsBottomSheet also i have bottom sheet which i want to open from 3 different bottom sheet and i'm getting the same error
Attempt to present <TrueSheet.TrueSheetViewController: 0x125d9d000> on <UIViewController: 0x106216370> (from <RNSScreen: 0x108b7bc00>) which is already presenting <TrueSheet.TrueSheetViewController: 0x107abb800>.
Right. you can't open other sheet outside the parent. No way around that
i thought if i put this child sheet to Home screen so it becomes independent from parent sheet
oh, do you mean that when i try to open it globally it doesn't understand what sheet to open because that child sheet stay belong Home screen and parent sheet at the same time?
You can only open 1 sheet at a time UNLESS it's a child of a the currently opened sheet. I suggest you take a look at the example project. It has example of children sheets that you can reference.
Closing this.
i got specific bug on IOS when using true sheet - i want to open the same sheet from screen (home page) and from another sheet (that also on the home page) so i put my true sheet component to home page and to 'parent' sheet, on Android it works fine but IOS doesn't open any of them and return this - i found only one solutionput my sheet component to the parent screen (home) and when open it from another sheet close 'parent' sheet before open new one, but is there any other solution?
Attempt to present <TrueSheet.TrueSheetViewController: 0x125d9d000> on <UIViewController: 0x106216370> (from <RNSScreen: 0x108b7bc00>) which is already presenting <TrueSheet.TrueSheetViewController: 0x107abb800>.