From d8d38fbbc6cd5cbf6af415a7bb7d3b007394b756 Mon Sep 17 00:00:00 2001 From: "Declan L. Scott" Date: Thu, 8 Feb 2024 12:44:06 -0600 Subject: [PATCH] fix(frontend): Reset collapsible on navigation --- frontend/src/components/pages/Restaurant.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/pages/Restaurant.tsx b/frontend/src/components/pages/Restaurant.tsx index fde4d88..659a77f 100644 --- a/frontend/src/components/pages/Restaurant.tsx +++ b/frontend/src/components/pages/Restaurant.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +import { useEffect, useState } from "react"; import { useQuery, useSuspenseQuery } from "@tanstack/react-query"; import { MapPin, Phone } from "lucide-react"; @@ -29,6 +29,10 @@ export function Restaurant() { const [isOpen, setIsOpen] = useState(false); + useEffect(() => { + setIsOpen(false); + }, [slug]); + if (isLoading) { return ; }