Skip to content

Instantly share code, notes, and snippets.

@aravi365
Created February 5, 2022 06:08
Show Gist options
  • Save aravi365/b526018fdc26e4ef4fda99ce60c4058a to your computer and use it in GitHub Desktop.
Save aravi365/b526018fdc26e4ef4fda99ce60c4058a to your computer and use it in GitHub Desktop.
import React from 'react';
import {ActivityIndicator} from 'react-native';
export const withLoaderList =
Comp =>
({isLoading, ...props}) => {
if (isLoading) {
return <ActivityIndicator color={'green'} />;
} else {
return <Comp {...props} />;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment