I am using the following component:
export const Home =() =>
<div className="cardBox" style={styleBox}>
<CardTrail></CardTrail>
<CardTrail></CardTrail>
<CardTrail></CardTrail>
<Footer></Footer>
</div>
and I am was trying to make a get API request using AJAX. Cant find a suitable way to do it with functional components. I achieved it with class components via the help of componentDidMount() lifecycle method.