How to import icons from multiple files in react native vector icons?

Roman Akash

If I wanted to use Ionicons and MaterialDesign Icons from react native vector icons in the same file, how should I import it?

import Icon from 'react-native-vector-icons/MaterialIcons';

(and)

import Icon from 'react-native-vector-icons/Ionicons';

in the same file

Roman Akash

After going through the original source files I found out that the icons was exported like

export default iconSet

So you could just use any arbitrary name to import. The final code was

import MaterialIcon from 'react-native-vector-icons/MaterialIcons'; import Ionicon from 'react-native-vector-icons/Ionicons';

Thankyou Fran Rios

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

import Icon from 'react-native-vector-icons/Ionicons'

How to use React Native vector icons?

React Native Custom Icons w/ Vector Icons

How do I show a vector icon in my ToolbarAndroid from react-native-vector-icons (react native)

Switching from React Native Icons to React Native Vector Icons when using Scrollable Tab View

react-native react-native-vector-icons: How to use font awesome icons

How to change the icons of multiple files from terminal?

How to link react-native-vector-icons to project

How to choose icons with same name in React Native Vector Icon

How to resolve ':react-native-vector-icons' error for a successful build?

how to add @expo/vector-icons in react native app?

How to add badge to react-native-vector-icons

How I can use React Native vector icons from different directory inside same component?

Icons not loading correctly react-native-vector-icons

react-native-vector-icons Android

React native vector icons - dynamic type

React Native - Vector icons in Navigation bar

React-Native-Vector-Icons error on build

React native web issue with react native vector icons in storybook

react-native-vector-icons/ react-native-elements not working

Problem with "react-native-vector-icons" in React native

How to use react-native-vector-icons with react-native-web?

How to create icons from multiple image files fast (in the typed code)?

How to import material icons files in an angular library

Could not resolve all files for configuration ':react-native-vector-icons:classpath'

React Native Elements icons (react-native-vector-icons) showing a question mark instead of actual icon

How to import font awesome icons in React project

React native icons

How to model a button with icons in react-native