react-native-cacheable-image
react-native-cacheable-image copied to clipboard
Suggestion: passing a customised ActivityIndicator or SpinnerComponent
I have read your source code and found that there is no way to pass a customised loading spinner to replace the default ActivityIndicator. The default one is ugly and we would like to replace it with our own component. Maybe you can just rewrite this part to support this feature. Or I can just send you a PR if you are acceptable.
render() {
if (!this.state.isRemote && !this.props.defaultSource) {
return this.renderLocal();
}
if (this.state.cacheable && this.state.cachedImagePath) {
return this.renderCache();
}
if (this.props.defaultSource) {
return this.renderDefaultSource();
}
if (this.props.customSpinner) {
return (
this.props.customSpinner();
);
} else {
return (
<ActivityIndicator {...this.props.activityIndicatorProps} />
);
}
}
a PR would be welcome for this. Your example above looks good to me.
we can merge it into the dev branch.. which I am planning on being the last branch using react-native-fs .. I plan on converting it to use react-native-fetch-blob after that.