score:1

const myData = [
    {
      id: 1,
      name: "Lorem Ipsum",
      content: (alt) => (
        <>
          <img
            src="https://images.unsplash.com/photo-1637704758245-ed126909d374?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwxNHx8fGVufDB8fHx8&auto=format&fit=crop&w=500&q=60"
            alt={alt}
          />
        </>
      )
    }
  ];

const output = myData.map((x) => (
    <div key={x.id}>
      <p>{x.name} sa</p>
      <p>{x.content(x.name)}</p>
    </div>
  ));

score:1

export default function App() {
const myData = [
    {
      id: 1,
      name: "Lorem Ipsum",
      content: function(){
        return (
        <>
          <img
            src="https://images.unsplash.com/photo-1637704758245-ed126909d374?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHwxNHx8fGVufDB8fHx8&auto=format&fit=crop&w=500&q=60"
            alt={this.name}
          />
        </>
      )
        }
    }
  ];

 const output = myData.map((x) => (
         <>
           <div key={x.id}>
             <p>{x.name} sa</p>
             <p>{x.content()}</p>
           </div>
         </>
  ));

  return <div className="App">{output}</div>;
}

score:1

 const myData = [
     function(){
        const entry = {
           id: 1,
           name: "Lorem Ipsum",
        }
        return {
          ...entry,
          content: (
             <>
               <img
                 src="your image source"
                 alt={entry.name}
               />
             </>
           )
        }
     }()
  ];

Related Query

More Query from same tag