Skip to content

Modal on top of Tab Navigator #388

Closed Answered by sbkl
sbkl asked this question in Q&A
Discussion options

You must be logged in to vote

Keeping playing with it and found the solution:

File structure

app/
  _layout.tsx
  (root)/
    _layout.tsx
    modal.tsx  
    (tabs)/
      _layout.tsx
      home.tsx   

And each component:

app/_layout.tsx

import { Slot } from "expo-router";
import { StatusBar } from "expo-status-bar";
import { AuthProvider } from "../src/context/AuthContext";

export default function Layout() {
// Logic for SplashScreen, static assets loading...
  return (
    <AuthProvider>
      <Slot />
      <StatusBar />
    </AuthProvider>
  );
}

app/(root)/_layout.tsx

import { Stack } from "expo-router";

export default function ModalLayout() {
  return (
    <Stack>
      <Stack.Screen
        name="modal"
  …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sbkl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant