kfiroo / react-native-cached-image

CachedImage component for react-native
MIT License
938 stars 470 forks source link

Use local images as defaultSource and fallbackSource #137

Closed rupalpatel0008 closed 5 years ago

rupalpatel0008 commented 5 years ago

Issue: Local images are not rendering when provided to defaultSource and fallbackSource react-native version: 0.56.0 react-native-cached-image version: 1.4.3

This is the code I am using to render my remote image.

Images.js

const images = {
  defaultUser: require('../Images/default-user.png'),
};

export default images;

Home.js

            <CachedImage
                source={{
                  uri: this.props.user.selfie
                }}
                style={styles.profilePicStyle}
                defaultSource={Images.defaultUser}
                fallbackSource={Images.defaultUser}
              />

When I used a remote image for fallbackSource it worked.

Blutude commented 5 years ago

I have the same issue. Did you find a way to fix this?