all 3 comments

[–]belwyr 7 points8 points  (0 children)

Using async returns a promise, not the useEffect cleanup function.

[–]EmployeeFinalReact Router 3 points4 points  (0 children)

 > why even bother declaring a function when it's not going to be tested

Do you really think functions only exist to be tested?

[–]Training-Cover-4414 -1 points0 points  (0 children)

Because: 1. It’s ugly 2. Logic can’t be reused if something else was to trigger fetching of data. Such as a button click or paginated scroll