Home > database >  How to use image src dynamically
How to use image src dynamically

Time:12-19

I am trying to import images that are in the src folder but vs code tells me that the names of the files that I am importing are not being used in the code. Does anyone know why?

import

I want the images to be displayed in the carousel without any problem.

CodePudding user response:

I can see that Ashraful Mijan already answered above. I just thought that I would add something. Instead of importing them from your src folder, you could put them in your public folder then you would not need to import them and could just set the path directly in the img tag.

For example, if you have your images stored in public/assets, then you could just do this in your carousel.

<img src="/assets/image1.jpg" />

CodePudding user response:

You should remove the extra quote for src

<img src={atlus} />
  • Related