0

how to display Img array all image in react js data*** import im1 from "../Image/10007.jpg" export const Data =[ { name:"aminur",

   Img:[im1,im1,im1]
}

]enter code here

code :

import React from 'react'
import "./Content.css"
import { Data } from './data'
const Content = () => {
  return (
    <div className='content'>
      {Data.map((item)=>{
        return(
            <div className='text'>
                <img src={item.Img[0]} alt="" />

                
            </div>
        )
      })}
    </div>
  )
}

export default Content
1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Sep 19, 2022 at 6:59

1 Answer 1

1

What I understood from your question is how to display all the images under Img array which is inside an another array of objects.

import React from 'react'
import "./Content.css"
import { Data } from './data'
const Content = () => {
  return (
    <div className='content'>
      {Data.map((item)=>{
        return(
            <div className='text'>
              {item?.Img.map(image=>(
                <img src={image} alt="" />
              ))}
            </div>
        )
      })}
    </div>
  )
}

export default Content

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.