Package
Description
Problem
I would like to reduce overall bundle size. React native(metro) does not support tree shaking so it is up to developer to only import modules that are needed. There is no app that need all icons and only a few are needed at the time.
Solution
Export all icons as a separate sub modules of the lucide-react-native package.
Workaround
It is currently possible to import separate icons from dist subfolder.
import HelpCircleIcon from 'lucide-react-native/dist/esm/icons/help-circle'
import QrCodeIcon from 'lucide-react-native/dist/esm/icons/qr-code'
However those do not have a type and typescript throws error
Could not find a declaration file for module 'lucide-react-native/dist/esm/icons/arrow-left'.
Use cases
Import only icons that are actually needed.
import HelpCircleIcon from 'lucide-react-native/dist/esm/icons/help-circle'
import QrCodeIcon from 'lucide-react-native/dist/esm/icons/qr-code'
Checklist
Package
Description
Problem
I would like to reduce overall bundle size. React native(metro) does not support tree shaking so it is up to developer to only import modules that are needed. There is no app that need all icons and only a few are needed at the time.
Solution
Export all icons as a separate sub modules of the lucide-react-native package.
Workaround
It is currently possible to import separate icons from dist subfolder.
However those do not have a type and typescript throws error
Use cases
Import only icons that are actually needed.
Checklist