How can i stop the infinite loop issue of the component. So i have Parent and a child component
Parent.js
const { revertBack, onRevert