I don't know where I'm wrong. I want to pass that parameter as a state to Link tag and get that in another component.
import React from 'react'
import {Link} from "react-router-dom";
export default class CategoryList extends React.Component{
render(){
return(
<tr>
<td>
<Link to={{pathname:"/Topics/" + this.props.row.Occupation+"/"+this.props.row.objectId +'/id'+'/'+this.props.userName, state:{description:this.props.row.Description}}}>
{this.props.row.Occupation}
</Link>
</td>
<td>{this.props.row.Description}</td>
</tr>
)
}
}
index.js
<Route path="/Topics/:Occupation/:objectId/:id/:userName" component={Main} />
I want to pass it here and access the state given in Link tag. So your help will be great.