necolas / react-native-web

Cross-platform React UI packages
https://necolas.github.io/react-native-web
MIT License
21.61k stars 1.79k forks source link

React native vector icons doesn't work #1722

Closed 0xmikko closed 4 years ago

0xmikko commented 4 years ago

React native vector icons requires tabBarIos Running a web version of react native, poduces an error:

./node_modules/react-native-vector-icons/lib/tab-bar-item-ios.js
Attempted import error: 'TabBarIOS' is not exported from './react-native'.

How to reproduce Import react-native-vector-icons with react-native-elements and create an Icon object:

import Icon from 'react-native-vector-icons/Ionicons';
const icon = <Icon
                name={iconName}
                size={size}
                color={color}
              />

Expected behavior Icon which could be used in React code

Environment (include versions). Did this work in previous versions? It works in 0.12.3 and doesn't work in next version when support of tabBarIos was removed.

necolas commented 4 years ago

Please open an issue against their repo.

Also worth noting that library is not a good approach for web, which should prefer modular svg for icons in almost all cases over fonts