How I am calling Link
<Link to={{ pathname: row.route, partname: "test" }} className='nav-links'>
<Button variant="contained">Choose {row.name}</Button>
</Link>
How I am trying to access it:
export default function Products() {
const location = useLocation()
const partname = location.state?.partname
console.log("partname: " + partname)
But partname is always null even though I am passing in partname = "test".
I am pretty new to React and it seems like this is the standard way to pass in arguments to functions components. Thanks in advance! \
Using: "react-router-dom": "^6.0.1",