Skip to content

How do I setup a navigation loop? Two dynamic routes that the user could constantly navigate over? #538

Answered by lewisd1996
lewisd1996 asked this question in Q&A
Discussion options

You must be logged in to vote

I have fixed it, it seems removing the _layout.tsx's in my sub folders fixes the issue. I suppose they didn't serve much purpose, there were no subroutes needed in /car or /manufacturer... maybe I have still done something wrong, but for now, this file structure works:

├──/feed
│   ├──_layout.tsx
│   ├──index.tsx
│   ├──/car
│   │   ├── [car_id].tsx
│   ├──/manufacturer
│   │   ├── [manufacturer_id].tsx

My _layout.tsx in /feed looks like this:

import { Stack, useNavigation, useRouter } from "expo-router";
import React from "react";

import { BasicScreenHeader, DrawerHeader } from "../../../../components";

export default function FeedLayout() {
  const navigation = useNavigation();
  con…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by lewisd1996
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