Hey everyone! Im currently building an application using Nextjs 13 and shadcn/ui for the UI. I have a user page where they can click a button to open a dialog box that displays their followers. The user can also click on a user to navigate to their page using the Nextjs <Link /> component. However, when navigating to the next user’s page, the shadcn/ui <Dialog /> component stays open. The expected behavior is the dialog box would close upon navigating to the next page. Usually I would achieve this using a useEffect cleanup function but I don’t know how I would do that with the shadcn/ui component. Below is the code for the component I have
<Dialog>
<DialogTrigger>Followers</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Followers</DialogTitle>
</DialogHeader>
// followers displayed here
</DialogContent>
</Dialog>
