Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

200
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

0

Have you tried this syntax?

<Image source={{uri: localPath}}/>
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda