Home  >  Q&A  >  body text

How to hide photos in a project

<p>I want to add pictures to my project through img tags, I wrote the code as follows, but the pictures are not displayed...I want the pictures folder to be inside the public folder.</p> <p>Cannot display photo in project</p>
P粉587780103P粉587780103408 days ago370

reply all(1)I'll reply

  • P粉727531237

    P粉7275312372023-08-11 11:52:05

    Try this:

    import { ReactComponent as SamImage } from "../asset/image/sam.png";
    //Rest of your code...
    export default function company(){
      return(
        <SamImage />
    )}
    

    reply
    0
  • Cancelreply