I am faced with an issue in my code where I am attempting to retrieve the path of my page within the getServerSideProps
function. However, I have encountered a problem as the type of params
is currently an object.
How can I convert this object into a string?
export const getServerSideProps: GetServerSideProps = async (context) => {
const { slug } = context.params // Property 'slug' does not exist on type 'ParsedUrlQuery | undefined'.ts(2339)
return {
props: {
},
}
}