react-native-web
react-native-web copied to clipboard
prefer to load @2x image by default for import local images
For local icon image files like this:
icon.png
[email protected]
[email protected]
And normal usage code in RN Native:
<Image source={require('./assets/icon.png')} />
RN Native will automatically choose a best size for the current device through pixel ratio.
But on the web, the code require('./assets/icon.png')
will load the @1x file, it makes the icon be blurred on high resolution screens like Apple retina-display or almost all of smart phones today.
Maybe a better default action is to load the @2x file (should be a webpack job?), this choice will solve the problem and it load less size of files on network than to load both @1x and @2x.
Hope RN-Web to be more easy to use 🙂
https://github.com/peter-jozsa/react-native-web-image-loader
can help you