One of the challenges I am facing involves accessing a query parameter with a hyphen in its name within a route:
/?previous-page=building-details
Within my Page component:
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'm trying to figure out how to access this specific parameter from the props of the page, any tips on achieving that?