When I try to put an image like this, I get this error, does anyone know how to fix it? I've been trying to do the same thing with React and can't solve it for hours. It happens for SVGs and PNGs.
- Welcome to Stack Overflow! Please do not upload images of code/data/errors.Wing– Wing2023-08-07 12:21:08 +00:00Commented Aug 7, 2023 at 12:21
- Here is a related question that solves the problem. stackoverflow.com/questions/33907218/…Mansur– Mansur2023-08-07 12:28:38 +00:00Commented Aug 7, 2023 at 12:28
- I also found a good workaround I will be careful, thanks!SJH8730– SJH87302023-08-08 00:25:39 +00:00Commented Aug 8, 2023 at 0:25
Add a comment |
1 Answer
You are having this problem because you cannot give dynamic paths for static assets in React Native. But you can map it from a list if you push all your objects inside one list with require('...) properties.
This should give you more in-depth information about how you can make it possible.
How can I show dynamic images with require() in React Native?