Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invariant Violation: requireNativeComponent: "FastImageView" was not found in the UIManager in react native

When I'm writting this code error is showing please let me know, Where i'm worng?

import React, { Component } from 'react'; import { StyleSheet, Text, View, TouchableOpacity, FlatList, Modal, } from 'react-native';

import FastImage from 'react-native-fast-image'

const Imagegallery = () => (
    <FastImage
        style={{ width: 200, height: 200 }}
        source={{
            uri: 'https://unsplash.it/400/400?image=1',
            priority: FastImage.priority.normal,
        }}
        resizeMode={FastImage.resizeMode.contain}
    />
)

export default Imagegallery
like image 624
Manoj Avatar asked Nov 18 '19 05:11

Manoj


2 Answers

After installing react-native-fast-image you have to run pod command in you ios directory.

So run this command :

cd ios
pod install

Then run your project.

like image 72
Kishan Bharda Avatar answered Nov 06 '22 08:11

Kishan Bharda


It's late but for those who got this error, I think It's better to use RN 60.0 because of the auto-linking feature since they didn't provide manual installation for RN < 60.0.

if you're using RN > 60.0 just paste this to your terminal

yarn add react-native-fast-image

and then rebuild the app

react-native run-android

It should now work.

like image 5
Moralde-Sama Avatar answered Nov 06 '22 08:11

Moralde-Sama