skip to Main Content

I have an app with 4 Tabs I want to be able to present a Modal screen on any of the Tab Items. I’m trying to get my head around expo-router, however, It’s not going through.

My file structure is:

app
    (auth)
        _layout.js
        Onboard.js
        SignIn.js
        ForgotPassword.js
    (tabs)
        _layout.js
        Home1.js
        Home2.js
        Home3.js
        Home4.js
_layout.js
index.js

Do I need a new group with:

_layout.js
Modal.js

and does this go under my (tabs) folder of the app?

Any help greatly appreciated.

2

Answers


  1. You can do this by adding Modal screen what ever tab you want. like use stack-navigation inside tabs.

    Login or Signup to reply.
  2. Add your-modal.js to your (tabs) folder. Then in (tabs)/_layout.js add a Tab-screen with name=’your-modal’ and options={{href:null}}.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search