I was learning React and came across something called "Inversion of control". Then, after some research done here https://dev.to/loweisz/use-the-inversion-of-control-p