I'm getting the correct data in component A, now I need to pass that value to component B. In the first component is a click event that receives the clicked item, now I need to pass that clicked value to component B in order to do further formatting.
    class ReportsData extends Component {
    constructor(props) {
    super(props) 
        this.state = {
            value: null
    }
    render() {
    const {reports, employees} = this.props;
    let sortedReports = _.sortBy(reports, function(o) { return new moment(o.date); }).reverse();
    const handleClick = (item) => {
        return item // --> 2011 --> I NEED TO TAKE THIS VALUE AND PASS IT TO ReporstDetails COMPONENT // When I do setState = ({value: item}) error ???
    }
    const listReports = sortedReports.map(item => {
        return (
        <tr key={item.rowNumber}>
            <td>  {item.year}</td>
            <td> {item.month}</td>
            <td> {item.bruto_ukupno}</td>
            <td> {item.neto_plata}</td>
            <td> {item.topli_obrok}</td>
            <td> {item.doprinosi}</td>
            <td> {parseInt(item.ukupno_plata)}</td>
            <td className="table-actions">
                <Link onClick={this.handleClick.bind(this, item.year)}
                    to={`/reports/details`}>
                    <PieChart size="21"/>
                </Link>
            </td>
        </tr>
    )});
    return (
        <div className="container">
        <div>
            <header>
            <h4>A complete list of reports</h4>
            <p>Details available by clicking on an item </p>
            </header>
            <hr />
        </div>
        <table className="table table-striped">
        <thead>
        <tr>
            <th>Year</th>
            <th>Month</th>
            <th>Bruto</th>
            <th>Neto</th>
            <th>Meal</th>
            <th>Taxes</th>
            <th>Employees</th>
            <th>Details</th>
            <th></th>
       </tr>
        </thead>
         <tbody>
            {listReports}
        </tbody>
    </table>
   </div>
    );
}
}
export default ReportsData;
When I try to setState and pass it as props, I'm getting undefined.
I'm a beginner, so please forgive me and help me.
 
     
     
     
     
    