- It is also known as HOC. In React, HOC is an advanced technique for reusing component logic. It is a function that takes a component and returns a new component.
- HOC component: hoc > WithLoading.tsx
This component returns orginal component with loading messages.
- component > pages > Employee.tsx
This is the simple component to show the employee information.
- component > pages > Department.tsx
This component will pass the Employee component in the HOC.