1

I am using useRouter and Link, while navigating through my webapp. I attach query string to the links so that i can use the passed data of the query, in the page i am redirecting the user to. which works fine. however, on page reload / refresh, the query string loses its data which makes the reload page crush. i have tried looking for solutions here and How to keep route parameters even page refresh and Query values lost on page refresh in Next js? [Example given] are some of the pages i have visted, still not giveing me the solution I need. below is my code

<Link href={{
                  pathname: '/types/[type]/this' ,                                   
                  query: {
                    status: Order.status,
                    description: Order.Description,
                    name: Order.OrderName,
                    tracking: Order.Tracking,
                    flexibility: Order.Flexibility,
                    type: Order.Type,
                    category: Order.Category,
                    id: Order.Id,
                    beneficiary: Order.Beneficiary,
                    time: Order.Time,
                    oc: Order.OC,
                    aurthor: Order.Author
                  }
                }} as={`/types/${router.query.type}/this`}><a className={classes.link}>Manage <b className={classes.l}>{`${Order.OrderName}`}</b></a></Link>

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.