How to pass id from one component to another component in react in functional component?
this.props
doesn't work for my functional component?
- Parent component
<Link to={{
pathname: '/details',
state: {id: 1, name: 'sabaoon', shirt: 'green'}
}}>
Learn More
</Link>
2.Child Component
{props.location.state.name}