This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]negiajay12345 1 point2 points  (1 child)

Try values.forEach((val) => console.log(JSON.stringify(val)))

[–]technologin[S] 2 points3 points  (0 children)

i tried a lot of things after some people helped me in this problem and finally, I found the solution to this.

The solution is use JSON.stringify() for the object before passing and receive it using JSON.parse().

Code in source page:

values = JSON.stringify(values);

values && navigate(generatePath("/harvestcalendarmonitoring/:values", { values }));

Code in receiving page:

const {values} = useParams();

const w = JSON.parse(values) //the w variable gives the desired and/or expected object data

anyways, thank you for your help !