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

143
Views
can't import dynamic value inside curly braces - Zero to Mastery React

it's my first question on StackOverflow; quite basic

I'm studying the "Zero to Mastery" react course, and I can't understand why I can't use ${} or {} inside the image source, I mean the props.monster.id

import "./card.styles.css";

export const Card = (props) => (
  <div className="card-container">
    <img src={"https://robohash.org/${props.monster.id}?set=set2"} />
    <h1> {props.monster.name} </h1>
  </div>
);

and this is its brother (Sorry for my form of question)


import { Card } from "../card/card.component";

import "./card-list.styles.css";

export const CardList = (props) => {
  return (
    <div className="card-list">
      {props.monsters.map((monster) => (
        <Card key={monster.id} monster={monster} />
      ))}
    </div>
  );
};
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

<img src={`https://robohash.org/${props.monster.id}?set=set2`} />

replace the "" with backticks like i did in the example

about 4 years ago · Juan Pablo Isaza Report

0

You have to use backticks instead of quotes to concatenate string and variables:

export const Card = (props) => (
  <div className="card-container">
    <img src={`https://robohash.org/${props.monster.id}?set=set2`} />
    <h1>{props.monster.name}</h1>
  </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!