1.2.1 • Published 2 years ago

@mahmoudaliibrahim/react-native-loading-view v1.2.1

Weekly downloads
16
License
MIT
Repository
github
Last release
2 years ago

@mahmoudaliibrahim/react-native-loading-view

Getting started

A simple loading view for react-native apps, can be used while fetching data from remote server.

npm:

$ npm install @mahmoudaliibrahim/react-native-loading-view --save

yarn:

$ yarn add @mahmoudaliibrahim/react-native-loading-view

PropTypes

PropDescriptionType
containerStylethe containing view styleObject
childrenview to be wrapped by the loading viewReact Component
isLoadingcurrent loading view stateBoolean
backgroundColorloading view background colorString
textoptional text to show during loadingString
textStyleoptional text styleObject
loaderStyleloader container styleObject
indicatorColorcolor of the loading indicatorString
indicatorSizeloading indicator size (React native ActivityIndicator size)String or Number
unmountboolean to unmount the children view while isLoading is trueBoolean
renderLoaderprop for using custom loader instead of default oneFunction

Usage

import React, { useState } from "react";
import { Text, StyleSheet } from "react-native";
import LoadingView from "@mahmoudaliibrahim/react-native-loading-view";

const App = () => {
  const [loading, setLoading] = useState(true);

  setTimeout(() => {
    setLoading(false);
  }, 2000);

  return (
    <LoadingView
      containerStyle={styles.container}
      isLoading={loading}
      size={"small"}
      unmount
    >
      <Text>Hello React</Text>
    </LoadingView>
  );
};

export default App;

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: "center",
    justifyContent: "center",
  },
});
1.2.0

2 years ago

1.0.9

2 years ago

1.2.1

2 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago