Skip to content

Improved the useEffect usage

Zhou Fang requested to merge github/fork/linkfang/zhoufang/master/issue93 into master

For issue93

  • Added all dependencies suggested by ESLint.

  • Instead of using useEffect in CompanyInformationContacts component, now it's using onChange (of some input components) to handle the logic

Update on June 18: Overall, less API calls and less dependencies and if statement conditions in useEffect. Won't unnecessarily trigger useEffect.

  • Removed furthestpage from the dependency array by changing the way to get the field id when user chooses "Start New Application". Instead of getting the field id by doing a GET request, now the field id will be updated after a successful POST request.

  • Removed formik from the dependency array by using destructuring to get only the setFieldValue method.

  • Removed useEffect in SigningAuthority component, as the update/operation will be triggered when we get the data in CompanyInfo component.

Merge request reports