DEV Community

Discussion on: Build an amazing Job Search App using React

Collapse
 
myogeshchavan97 profile image
Yogesh Chavan

Thanks. Have you added the onClick Handler inside the components/JobItem.js file for the div like this?

<div className="job-item" index={index + 1} onClick={() => onItemClick(id)}>
Enter fullscreen mode Exit fullscreen mode

You also need to add the handleItemClick function inside the HomePage.js file like this

const handleItemClick = (jobId) => {
    setPage('details');
    setJobId(jobId);
  };
Enter fullscreen mode Exit fullscreen mode