Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

React native : import from a distant directory (and got an error)

$
0
0

I put all my images in a folder at the root of my project and I'm using them in the code that I write.Howether there seems to be an error (ex : Cannot find module '../../../assets/Structure.png' or its corresponding type declarations because of:import structure from "../../../assets/Structure.png";). It still work when I do my yarn start but it seems to be a potential issue. Any idea of how to make it work without error? The issue seems to be with the '../'.My project is like this :

src --> pages --> page1 --> index.tsx

assets --> image.png


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>