Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6208

How Would I Types to this function call?

$
0
0

The following tests pass with just import Icon from 'react-native-vector-icons/Ionicons';, but when I add Icon.loadFont(); to load the font, the following error appears. How would I add types to that function call or is that unrelated.

Code:

import Icon from 'react-native-vector-icons/Ionicons';
Icon.loadFont(); // Error here

Error (From npm test):

    RNVectorIconsManager not available, did you add 
the library to your project and link with libRNVecto
rIcons.a? Try running `react-native link react-nativ
e-vector-icons` and recompiling.
       6 | import moment from 'moment';
       7 | import Icon from 'react-native-vector-icons/Ionicons';    >  8 | Icon.loadFont();
         |      ^       9 | 
      10 | // Screen Dimensions
      11 | const { height, width } = Dimensions.get(
'window');

      at ensureNativeModuleAvailable (node_modules/r
eact-native-vector-icons/lib/ensure-native-module-av
ailable.js:13:11)
      at Function.loadFont (node_modules/react-nativ
e-vector-icons/lib/create-icon-set.js:148:7)
      at Object.<anonymous> (src/TimePicker.tsx:8:6)      at Object.<anonymous> (src/index.js:4:1)

I've already tried the recommended npm command in the error:

react-native link react-native-vector-icons

Viewing all articles
Browse latest Browse all 6208

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>