import React from 'react'; import { useParams, useHistory } from 'react-router-dom'; import { candidatesList } from '../Home/sections/Description'; import classes from './Candidate.module.scss'; const Candidate = () => { const history = useHistory(); const { id: candidateId } = useParams(); const currentCandidate = candidatesList.find((el) => el.id === Number(candidateId)); return (

Candidate name: {currentCandidate.name}

); }; export default Candidate;