Route modal - once route modal loaded , previous content getting wiped/replaced #7618
Goal Background context
Challenge / Observations: Question:
CleanShot.2023-10-09.at.08.06.00.mp4 |
Replies: 2 comments 5 replies
|
Ran Ran <Routes>
<Route file="root.tsx">
<Route path="dci/metro/visualizer/:device?/detail" index file="routes/dci/metro/visualizer/($device)/detail/index.tsx" />
<Route path="dci/metro/visualizer/:device?" index file="routes/dci/metro/visualizer/($device)/index.tsx" />
</Route>
</Routes>Looks like I was expecting the generated output to look like this: <Routes>
<Route file="root.tsx">
<Route path="dci/metro/visualizer/:device?" file="routes/dci/metro/visualizer/($device)/detail/index.tsx">
<Route path="dci/metro/visualizer/:device?/detail" index file="routes/dci/metro/visualizer/($device)/index.tsx" />
</Route>
</Route>
</Routes>This explains why my Outlet isn't working as expected 🤔 |
Here detail and index are at the same level. You need to either open the modal without using nested routes (remove detail) or if you want to make it linkable make detail a nested route of the visualization. |

Updating the thread with working solution of the original question
✅ Working code (doesnt make use of `index.tsx)
❌ Previously incorrect code
I was incorrectly using
index.tsxthinking I would still be able to generated nested route…