TanStack / router

🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering.
https://tanstack.com/router
MIT License
7.19k stars 486 forks source link

Usage of modal child route not possible since #1495 #1514

Closed nklhtv closed 3 weeks ago

nklhtv commented 3 weeks ago

@chorobin @schiller-manuel Ouch, that completely destroys the structure of my app. I've built an app with a route tree similar to the location masking example (without the actual masking)

const routeTree = rootRoute.addChildren([
  photoRoute,
  photosRoute.addChildren([photoModalRoute]),
  indexRoute,
])

where i have a:

If i refactor my route tree to something like photosRoute.addChildren([photosIndexRoute, photoModalRoute]) and render my list of items inside photosIndexRoute then i wont be able to show the modal on top of the list of items.

I've tried to open the location masking example in codesandbox and typescripts complain for using <Link to={'/photos'} now

Originally posted by @nklhtv in https://github.com/TanStack/router/issues/1495#issuecomment-2074713285

React Example: Deferred Data also navigates to non-leaf routes which renders an <Outlet /> for the child route.

Should we not use modals as a child routes going forward? What is the recommended way of handling UX like the one in the location masking example? How it should be refactored to work properly with the new version of react-router?

schiller-manuel commented 3 weeks ago

this is now fixed in https://github.com/TanStack/router/releases/tag/v1.31.0