Amy Blankenship
Jul 12, 2022

--

The root problem is they didn't account for a business layer in the design. It may be "inconvenient" to pass dependencies as properties, but Context (which custom hooks are tapping into other the hood) really limit your flexibility (you're directly tied to that context instance, and each context can only manage one value, so you have a proliferation of contexts). Conceptually, it's just like everyone imports the same export from an ES6 module (ew!), but we need Context to inform React of the changes so it can rerender. I'll go into all this more later.

--

--

Amy Blankenship
Amy Blankenship

Written by Amy Blankenship

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

Responses (1)