score:0

Accepted answer
function WomanDetails({ routeProps, data }) {
  const foundCard = data.find((card) => card.id === +routeProps.match.params.id);

  if (!foundCard) return null;

  return (
    <div className="woman-page">
      <img className="info-img" src={foundCard.image} alt="" />
      <h3 className="women-title">{foundCard.title}</h3>
      <p className="women-years">{foundCard.years}</p>
      <p className="women-nationality">{foundCard.nationality}</p>
      <p className="women-contribution">{foundCard.contribution}</p>
    </div>
  );
}

export default withRouter(WomanDetails);

Related Query

More Query from same tag