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

165
Views
How to use dynamic image path in next js

I am new in reactjs and i am working with nextjs,I am fetching image from datbase via api, Right now i am getting image name with full path ( url.com/imagename) but i want to know how can we use dynamic path, in other words if i have only "image name" (not full path) so how can i append "image path" for display image using next js? I tried with following code

{this.state.books.map((post, index) => {
        return (
          <div className="col-md-4"
              <div className="bookimg">
                <img src={post.image} />
              </div>
            </div>
         )
    })}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Let's say that post.image give you the image name only with mimi type.

{this.state.books.map((post, index) => {
    return (
      <div className="col-md-4"
          <div className="bookimg">
            <img src={`myurl.com/image/${post.image}`} />
          </div>
        </div>
     )
})}
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!