-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Error loading local image #16007
Comments
static images should be required statically for the packager to correctly bundle them(your first case). RN does not support dynamic require of assets or modules like that since there is not way for the package to know which files to include in the bundle unless we support a way to explicitly pass a list of such assets to the packager . this a client environment which is not the same as nodejs environment. Refer this document for some good vs bad patterns: https:/facebook/react-native/blob/1e8f3b11027fe0a7514b4fc97d0798d3c64bc895/docs/Images.md |
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
react-native -v
: command not foundnode -v
: v7.9.0npm -v
: 4.2.0yarn --version
: 1.0.2Then, specify:
Steps to Reproduce
(Write your steps here:)
Expected Behavior
Image should load
Actual Behavior
Image doesn't load and expo gives warning:
(Write what happened. Add screenshots!)
Reproducible Demo
This code works:
But this one gives error:
I simplified the code by removing the styling...
The text was updated successfully, but these errors were encountered: