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

222
Views
import files from parent/other directory in react

How do I import files from the parent/other directories in my react project? I want to import images from the images folder but I ran into an error Module not found: Error: Can't resolve '../assets/images/Web_SVG.svg'.

My Project Structure:

-- src
   ==> assets
        --> Images --> "Web_SVG.svg" (Image I want to import)

   ==> components
        --> pages
            - Home.js (File I'm working on)

   ==> Other Files (index.js, App.js, etc)

I tried a few solutions from this question here But it's not working for me.

Code for Home.js

import React from 'react';

//Importing Img
import { img } from '../assets/images/Web_SVG.svg';

export default function Home() {
    return (
        <>
            <div className="flex bg-red-50">
                <div>
                    <img src={img} alt="" />
                </div>
            </div>
        </>
    )
}

about 4 years ago · Juan Pablo Isaza
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!