Problem with react-native-fontawesome
react-native-fontawesome
is the official React Native component for Font Awesome.
It uses react-native-svg
as its svg supporting module. But in managed Expo app, import {svg} from 'expo'
is the right way to do it. Thus using react-native-fontawesome
might cause an Error:
Error: tried to register two views with the same name rnsvgrect
My Solution
I rewrote the component with Expo svg module in TypeScript. Now it works perfectly in managed Expo apps.
It’s called expo-fontawesome
Installation
$ npm i --save expo-fontawesome
or
$ yarn add expo-fontawesome
Usage
Exactly like the official component, very minor difference. See the repository for more details.