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

199
Views
Unable to load static images in react native

My folder structure :

-assets

--images

---potrait.png

-src

--file.js

I want to load my image in file.js but it throws error

<Image source={require('../assets/images/potrait.png')} />

Error:

error: Error: Unable to resolve module ../assets/images/potrait.png from D:\munish\Desktop\Invictus\reach-app\src\reactNativeCamera.js:

None of these files exist:

  • potrait.png
  • assets\images\potrait.png\index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Sadly, react disables imports outside of src. You should move them to inside the src or to the public folder where it can be accessed through / ( not recommended because it will replicate the image, should be avoided for the best optimization ).

about 4 years ago · Juan Pablo Isaza Report

0

Have you tried this syntax?

<Image source={{uri: localPath}}/>
about 4 years ago · Juan Pablo Isaza Report
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!