--

"Loading spinner hell" is caused by the need to push state down, which is caused by the fact that functional components with hooks rerender unnecessarily a _lot_. This is due to the fact that the component doesn't actually "exist" in the way a Class component does, but instead the function has to be called over and over. And really a lot of the architectural problems with React go back further than that, to the decision not to provide a place for business logic, especially API calls, to live. If we weren't trying to do fetches inside Views, which is an antipattern (but encouraged by the way React is built and documented), this would be a nonissue.

--

--

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