--

The big problem I see here is that you're always calling setData when getData returns, as if it's impossible for an earlier call to return back after a later call, and as if your component will never unmount. I think you should think a bit more on your mental model.

--

--

Amy Blankenship
Amy Blankenship

Written by Amy Blankenship

Full Stack developer at fintech company. I mainly write about React, Javascript, Typescript, and testing.

No responses yet