If Back Should Close It, Your Modal Is a Route
9 min read
A photo in a gallery that opens with useState has no address, so Back skips it and a shared link shows the grid. How I build those modals with TanStack Router, Next.js and Expo Router, and why Next.js needs a catch-all route to close one.


