Add iconFamily prop to Icon
See original GitHub issueThe current way Icon handles setting iconFamily
makes it impossible if you want to have a one off icon from one of the other icon sets.
I understand that at that point I should just import directly from react-native-vector-icons
but, if I do that, then I have to reapply all of the styles that I’ve put on IconNB
.
Is there another way to handle this one off case aside from adding a prop to Icon?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
reactjs - How to pass an icon as a prop? - Stack Overflow
I'm using props and I want to have "optionText" and "optionIcon" the 1st one I'm able to add but I'm not able to...
Read more >Build a Flexible React Icon Component | by Fabian Lee
The iconFamilies is a mapper object that each key refers to icons of a family. We can choose whatever icons we want by...
Read more >react-native-vector-icons: Icons and fonts for React Native apps
Set up a React Native project with TypeScript, configure react-native-vector-icons, and link custom fonts with no native code.
Read more >React Icon Component - Material UI - MUI
To import the icon component with a theme other than the default, append the ... Optionally, you can apply one of the theme...
Read more >Icons - Expo Documentation
It includes popular icon sets that you can browse at icons.expo.fyi. ... The source prop takes the relative path to refer the image....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey guy,
I faced the same problem and the solution is very simple!
You just need to import a tag “StyleProvider” and inside a style property pass a function “getTheme” a object with of the iconFamily you want to change in child components.
After that, you finally set a fontFamily to child components inside <StyleProvider/>
Follow the example:
The problem resolved and sorry for my English!
#1319 @gdaunton Take a look into this, probably what you are looking for