0

i am currently working on next j s routing and i am passing multiple parameters in URL and i want hide those parameters and just want to show some text

i am passing parameters in router as

Router.push({path name:"/Home/about/"+id +"/"+name+"/"+age});

and i have tried to implement it as

router.push("/Home/about/" +id +"/" + name+ "/" +age, '/Home/about/'+name, { shallow: true })

but it not working and my page is

-Home
  -about
   -[...index].j s
  -index.j s

i am not getting where i am doing mistake,thanks in advance

1 Answers1

0

step1: create a folder inside pages a named it about then inside it a file [...slug].js

pages:
_app.js
index.js
about:
  [...slug].js

Try this: Router.push(/about/${id}/${name}/${age})

Paiman Rasoli
  • 1,088
  • 1
  • 5
  • 15
  • could tell me how to pass url like home/USA/about/1/name/23,when i am passing like this it is not taking USA as params,it's taking about as a param but about is my folder name – Sai Manoj v Dec 31 '21 at 07:11
  • create a home folder inside pages then create a [...slug].js file inside the home folder. you can access all params. – Paiman Rasoli Jan 01 '22 at 06:03