In the Next.js I'm working,you can get a post in the route /posts/[id].tsx
,I am using react-query to make the get request.
I get the postId with
const {id}=router.query
But everytime I enter the page it sends the request to the server with undefined
,and also, do you guys know how to disable the React property of sending twice the requests when we enter a page? I think it is a waste of processing (correct me if I'm wrong please)
Thank you for reading until here !!!