ldn0x7dc / react-native-gallery

A pure JavaScript image gallery component for react-native apps with common gestures like pan, pinch and doubleTap, supporting both iOS and Android.
331 stars 116 forks source link

Proposal: Render loading and error states #41

Open almirfilho opened 7 years ago

almirfilho commented 7 years ago

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 commented 7 years ago

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