Skip to content

How to specify the order of screens in a tab layout? #47

Answered by trin4ik
rememberlenny asked this question in Q&A
Discussion options

You must be logged in to vote

How do you set the tab order in the demo app example?

check file app/(root)/(tab).js
u can only export Tabs, like this:

import { Tabs } from "expo-router";
export default Tabs;

but this way automatically generated tabbars. if u need your own order, u need listed it in <Tabs> component, like:

import { Tabs } from "expo-router";
export default function Layout1() {
  return (
    <Tabs>
      <Tabs.Screen name="settings" />
      <Tabs.Screen name="index" />
    </Tabs>
  );
}

settings first, index last. but u not need listed all other tabs, because expo-router listed it automatically. finnaly, all u need to set specific tab first is just:

import { Tabs } from "expo-router";
export default f…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by EvanBacon
Comment options

You must be logged in to vote
1 reply
@mwmcode
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #42 on October 03, 2022 19:58.