Skip to content

prefer to load @2x image by default for import local images #2153

@Alexorz

Description

@Alexorz

For local icon image files like this:

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 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions