use require and put track loading in react state