@expo/vector-icons and getImageSource() for use with TabBarIOS

#1

I have a use-case, where I need the image source for a specific icon within MaterialIcons.

react-native-vector-icons (even the one bundled) has a method called getImageSource() that Expo’s version doesn’t export. I’ve tried adding it myself, but then I get:

I’ve also created an issue on the repo: https://github.com/expo/vector-icons/issues/26

Unhandled Promise rejection: Error: RNVectorIconsManager not available, did you add the library to your project and link with libRNVectorIcons.a?]
- node_modules/@expo/vector-icons/vendor/react-native-vector-icons/lib/create-icon-set.js:99:8 in getImageSource
* src/routes/index.js:51:10 in render
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1610:15 in measureLifeCyclePerf
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1862:54 in _renderValidatedComponentWithoutOwnerOrContext
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1872:34 in _renderValidatedComponent
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1696:57 in performInitialMount
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1655:184 in mountComponent
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1327:53 in mountComponent
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1703:54 in performInitialMount
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1655:184 in mountComponent
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1327:53 in mountComponent
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1849:62 in _updateRenderedComponentWithNextElement
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1840:53 in _updateRenderedComponent
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1823:221 in _performComponentUpdate
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1804:116 in updateComponent
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1772:226 in performUpdateIfNecessary
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1353:50 in performUpdateIfNecessary
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1469:51 in runBatchedUpdates
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1382:99 in perform
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1382:99 in perform
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1476:28 in flushBatchedUpdates
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1412:101 in closeAll
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1388:52 in perform
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1481:107 in enqueueUpdate$1
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1510:33 in enqueueUpdate
- node_modules/react-native/Libraries/Renderer/ReactNativeStack-dev.js:1556:26 in enqueueSetState
- node_modules/react/cjs/react.development.js:167:31 in setState
* App.js:105:16 in prepareApp$
- node_modules/regenerator-runtime/runtime.js:65:44 in tryCatch
- node_modules/regenerator-runtime/runtime.js:303:30 in invoke
- ... 13 more stack frames from framework internals