Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

122
Views
How to make image clickable and redirect to its introduction value page in Reactjs

I have called an api then pick let says drinks. i picked drink name and images. Now i need to find the details about that drink.On clicking in this image it show about that . which all these think are present in the api. But i dont know how to do it.

import React from "react";


const DrinkList = (props) => {

  // const handleTextShow
  return (
    <>
      {props.drinks.map((drink, index) => (
        <div>
          <img
            src={drink.strDrinkThumb}
            alt="drink"
            width="300"
            height="300"
            onClick={handleTextShow}
          ></img>
        </div>
      ))}
    </>
  );
};

export default DrinkList;

strDrinkThumb shows photo about that and details be strDetails.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Just pass strDetails to your handleTextShow function

const DrinkList = (props) => {

    const handleTextShow = (drinkDetail) => {
        console.log(drinkDetail)
    }
    return (
        <>
        {props.drinks.map((drink, index) => (
            <div>
                <img
                    src={drink.strDrinkThumb}
                    alt="drink"
                    width="300"
                    height="300"
                    onClick={() => handleTextShow(drink.strDetails)}
            ></img>
            </div>
        ))}
        </>
    );
};

export default DrinkList;
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!