Call The Load Function From Props At Mount

Category: Others , React | December 14, 2016
Author: Zenika
Views Total: 278
Official Page: Go to website
Last Update: December 14, 2016
License: MIT

This is a higher order component (“HOC”). Its purpose is to call a load callback passed through the props of a component only once (at componentWillMount). This is convenient to load data from a backend for instance. The component shows a loading indicator when it’s waiting for the props to be defined. The loading indicator can be changed easily.

Preview:

call-the-load-function-from-props-at-mount