Real life React Higher Order Component use case (withLoading)

Higher Order Components in React are considered an advanced React topic.
I will try to simplify it and show one real life example that we will hopefully use (or base on it) in real life.

Let’s consider our day to day task which is to fetch data from somewhere and display them in the UI. We also need to handle errors and show loader messages to the user. This article will focus on the loader component.