In nextjs, I am trying to use useRouter in a component, but it is being shown that useRouter is returing null and so i am not able to get the query params.
// this is how i tried fixing it. But showed up the same error
const { query } = useRouter() || { query: { text: '' } };
