-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 srcSet or density sources #1595
Comments
Update: I'm trying to work around this by requiring the densities myself, but this gives me a "compile error":
The file is there. And it works on web. But on mobile this error shows up and I don't know what to do about it. I tried wrapping it in a conditional, putting it in a try catch block but no success. |
I'd like to bump this issue. Is there anything I can do to solve/work around this? |
Did you ever figure something out for |
Nah, I just hacked my way around it and wrote specific code for web. Eventually I just stopped using the project altogether because the user experience wasn't quite there. |
Is your feature request related to a problem? Please describe.
This is a feature request regarding images. Right now they don't seem to load the correct density causing images to not look sharp. I found another issue that's really old and the plugin that leads to has since dried up.
Describe a solution you'd like
At the very least it would be nice if I could just provide a srcSet as a workaround. Even better would be if that srcSet were to be created inside of the Image component.
I have the @2x and @3x images, they're just not being used on web.
Describe alternatives you've considered
I tried creating my own image component but it comes with a lot of challenges such as jsx not allowing me to use StyleSheet styles (meaning I'd have to inline all of my styles).
Update: to be clear, this works for me if I inline all the styles and write custom implementations for web and mobile (and forego the Animated.Image support and a couple of other things):
Additional context
I found this PR which was closed in favour of this PR which was then closed by this commit which just says "Requires bundler integration.".
It could be that what I'm really asking is for some documentation on this.
I am using expo, but to make sure I tried everything I first ejected and upgraded to
"react-native-web": "^0.12.2",
which was a pain because I had to change a ton of things for that. So please don't just close this 😅The text was updated successfully, but these errors were encountered: