expo / vector-icons

https://icons.expo.fyi
MIT License
647 stars 114 forks source link

Update readme import example #211

Closed jonsamp closed 2 years ago

jonsamp commented 2 years ago

When a developer imports an icon set from vector-icons, their app will load all the icons sets and also include them as assets in any published updates. This happens because this package exports all icons in one file, and when writing an import like import { Feather } from '@expo/vector-icons', all the other icon sets will be required, even though they are not used. They are loaded because Metro bundler does not support tree shaking/removing unused assets.

So, this PR bypasses that behavior by suggesting directly importing the icon set directly.

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/expoio/vector-icons/BgXfeUJfoXD4dHLauz85cj8gZeNp
✅ Preview: https://vector-icons-git-jon-vector-icons-imports-expoio.vercel.app