Hi, im suing next.js how to close a modal (using parrallel route @slot) when clicking on a link using this folder structure :
/app
layout.tsx
- /(main)
-- layout.tsx // check layout code below
-- /(home)
--- page.tsx
-- /@modal
--- /(.)photo
---- /[id]
----- page.tsx
-- /whatever
export default function Layout ({children, modal) {
return (
<div>
{children}
{modal}
<div>
)
}
Right know if im on page.tsx in /(home) and im clicling on link <Link href='/photo/123'>link</Link> the modal is opening (normal behavior, OK).
If from this page with the opened modal im clicking on <Link href='/whatever'>link</Link> the modalis closing.
but If from /whatever I click back on home, the modal is still opened .. could help me with this ?