brh55 / react-native-masonry

:raised_hands: A pure JS react-native component to render a masonry~ish layout for images with support for dynamic columns, progressive image loading, device rotation, on-press handlers, and headers/captions.
MIT License
1.32k stars 157 forks source link

Allow use of custom image component instead of default Image #43

Closed brh55 closed 7 years ago

brh55 commented 7 years ago

As requested per: #34 #29

This allows user to pass in a React.Component to Masonry which will be used to render the image component. Along with the custom component, users are able to pass along "default" properties which will propagate (<CustomImageComponent {...props.customImageProps}>) to each image.

brh55 commented 7 years ago

@kmcgill88 Can you review over the interface, just want to make sure it makes sense and if I need to brush up on the docs.

brh55 commented 7 years ago

@kmcgill88 Yup absolutely optional, otherwise it defaults to the stock Image component. So it doesn't necessarily have to be FastImage. Since it's Dep Inj/IoC, Masonry can remain completely JS (Expo compatible), but has the option to use it if need be 💃