-
Notifications
You must be signed in to change notification settings - Fork 24.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
image require variable problem #7015
Comments
You cannot use variables in require. All requires must be statically analyzable. That means you always have to write |
@satya164 my assets images in array ,I want to use the array elements require |
@ibeeger have the requires in an array instead. e.g. instead of [ 'img1', 'img2' ], you can have [ require('img1'), require ('img2') ] |
@satya164 thank you |
any other solution if i want require regular image based on some variable ? it costs much time if we have too many image. |
@MrPluto Packager needs to be able to statically analyze the images to be able to bundle them into the app automatically. As an alternative, you can bundle the images in your app manually and the use |
@satya164 thanks a lot 👍 |
hi,all |
maybe help requireAll |
I found this answer useful
|
Hi , please who can help me ? I have the same problem , the solutio of @satya164 is useful but in my case I want to register an image in data base , so I must use an variable inside require . Someone have an idea ? |
@kilaniba search about base64 images may could solve your problem |
@amorenew You can't more explication ? |
@kilaniba in React Native >> image to base64 >> |
@amorenew Thank you very much .barak allah fik. |
mycode
errcode
The text was updated successfully, but these errors were encountered: