I have a route that contains a query parameters with hyphen:
/?previous-page=building-details
In my Page:
import EnergyEfficiency from "@/ui/energy-check/energy-efficiency"
const Page = ({
params,
searchParams,
}: {
params: { id: string }
searchParams: { modernization: string; previousPage: string }
}) => {
const { modernization, previousPage } = searchParams
console.log(previousPage) // undefined
return <EnergyEfficiency addressID={params.id} />
}
export default Page
I want to access that parameter from the page props, how can I do that?