79091920

Date: 2024-10-15 22:26:08
Score: 1
Natty:
Report link

If you mean you want to create a settings tab and have related screens in a folder, you need to wrap settings in () so the folder name would be '(settings)' and the root layout would render it like so:

<Stack.Screen name="(settings)" options={{headerShown: false, ...}} />

And within the (settings) folder, you'll need another _layout.tsx file and then you can render your index file.

import {Stack} from "expo-router";

export type SettingStackParamList = {

  index: {
  }, 
  // any other screens can go here and you can pass parameters to them
};

export type SettingsStackNavigationType = NavigationProp<SettingStackParamList>;

const SettingsStackLayout = () => {


    return (
        <Stack>
         <Stack.Screen name="index"/>                 
        </Stack>
    )
}

export default SettingsStackLayout;

Now you can add whatever you want in your (settings) tab folder Useful YouTube video: https://www.youtube.com/watch?v=4-shpLyYBLc&t=485s

Reasons:
  • Blacklisted phrase (1): youtube.com
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Gabby Lulu