Skip to content
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

best practice to load local images #1728

Closed
aknad opened this issue Mar 24, 2022 · 2 comments
Closed

best practice to load local images #1728

aknad opened this issue Mar 24, 2022 · 2 comments

Comments

@aknad
Copy link

aknad commented Mar 24, 2022

Question

I can't understand what's the best way to load local images

the documentation suggests to use react-native-svg-transformer

In this issue I found the WithLocalSvg component but it's not officially documented

Also, in the latest comment of that issue there's another implementation suggestion

Which one should I use?
Thanks

@olessavluk
Copy link

olessavluk commented Jul 1, 2022

As I have understood from reading the issue you have referenced, the best practice is to:

  • use transformer as suggested
  • if for some reason you are unable to use the transformer, LocalSvg could work, but with possibly worse performance

From the author comment:

i'd still prioritise both battery energy and render time / user perceived latency by using the transformer approach, it'll quite certainly give wider budgets and thus handle more complex content with acceptable performance, especially on low-end devices, or when low on resources in general.

@bohdanprog
Copy link
Member

Hello @aknad,
As @olessavluk mentioned, the optimal method is to utilize react-native-svg-transformer. If you have any further questions, please don't hesitate to open a new issue for discussion.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants