react-native-gallery icon indicating copy to clipboard operation
react-native-gallery copied to clipboard

Proposal: Render loading and error states

Open almirfilho opened this issue 7 years ago • 1 comments

Hi,

I think it's a desirable feature to be able to render alternative states for each individual image in the gallery, for instance, a "loading" component while the image is still loading (achieved with the onLoad event handler of react native's Image component), or an "error message" component if a load error occurs (Image.onError event handler).

My proposal is to add something like renderLoading and renderError optional props, which are functions that return the content to be shown in the respective cases.

I can volunteer to send a pull request with an implementation for this feature. Just let me know what you think about this.

And thanks a lot for this package!

almirfilho avatar May 17 '17 01:05 almirfilho

Just made a PR (#42) with these features =)

almirfilho avatar Jun 07 '17 01:06 almirfilho