Hi I have an array of cat images which I recovered from Giphy api.
What I want to do is click on the image and console.log the url associated with the image.
The below code is what I tried.
All that happen as soon as I hit the search button console.log showed 25 undefined items.
So I think i'm passing information wrong, and it's detecting onCLick outside of the div
import React from "react";
function handleClick(props) {
console.log(props.gif);
}
const UserItem = props => {
return (
<div className="column">
<img
onClick={handleClick(props.gif)}
alt=""
src={props.gif}
className="ui image"
/>
</div>
);
};
export default UserItem;