React Native HOC Loader
HOC (Higher Order Component) Loader for Redux Containers
Installation
yarn add react-native-hoc-loader
or
npm install react-native-hoc-loader
Usage
Component sits within the container and fires off a function in a similar way to which componentWillMount
would.
An optional loading indicator can be passed from a state key to determine if a loading indicator should be displayed before rendering the intended component.
If there is no component, but you would like to display a simple text message, then pass undefined as the 4th argument and a string message as the 5th.
Example:
;;;; const mapStateToProps = // State key to determine if a load is in progress isLoading: reducerisLoading; const mapDispatchToProps = { // Function to fire off when container first loads ; }; ...const Container = ; ...
History
Discover the release history by heading on over to the releases page.
License
Unless stated otherwise all works are:
- Copyright © 2018+ Reme Le Hane
and licensed under: