get values form query params in next js
import { useRouter } from 'next/router';
const { query } = useRouter();
console.log(query.search) // for www.abc.com?search=xyz
get values form query params in next js
import { useRouter } from 'next/router';
const { query } = useRouter();
console.log(query.search) // for www.abc.com?search=xyz
next js get query parameters
// For example for URL: {__APP_URL__}/api/device/10001?q=hello
// The API route pages/api/device/[device_id].js has the following code:
export default function handler(req, res) {
res.status(200).json(req.query) // {"q":"hello","device_id":"10001"}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us