oblador / react-native-image-progress

Progress indicator for networked images in React Native
MIT License
1.72k stars 177 forks source link

Style not applied to Image when using fastimage #107

Open nicoladj77 opened 2 years ago

nicoladj77 commented 2 years ago

I created a wrapper component:

import React from 'react';
import { createImageProgress } from 'react-native-image-progress';
import ProgressBar from 'react-native-progress/Bar';
import FastImage from 'react-native-fast-image';

const Image = createImageProgress(FastImage);
const ImageWithProgress = (props) => {
  return <Image indicator={ProgressBar} style={props.style} {...props} />;
};

export default ImageWithProgress;

The issue is that style is not applied even when specified, for example here the bordrRadius is ignored, while it works correctly with FastImage

  <ImageWithProgress
    source={image}
    style={{
      height: '100%',
      width: '100%',
      resizeMode: 'cover',
      borderRadius: 20,
    }}
  />
Ducnhat96 commented 2 years ago

You can using imageStyle: imageStyle = {{ borderRadius: 8, }}