I am using "react-router-dom-v6" for navigation in my react-app, and I have scenario where I have to pass object OR Id from where I navigate how to pass an object or any id ? I tried with navigate function but it gives me nothing when I am use " useParams() ".
below is code that I am using for navigation
//page from where I navigate>>>
const navigate = useNavigate();
const on Press Edit = (item)=>{
//here item is object containing {name, id, email, number}
console.log('edit..', item)
navigate("/editemployee", { id: "25", item :item })
}
//page I navigated
const params = useParams();
const location = useLocation();
console.log('params', params, location)
//op>>
//params: prototype object
//
//location: {hash: ""
//key: "kixzun7e"
//pathname: "/editemployee"
//search: ""
//state: null}