DEV Community

Discussion on: Why Is This An "Anti-Pattern" in React???

Collapse
 
ab6d profile image
ab6d

The context API exists as well and can be a solution :
reactjs.org/docs/context.html

Mind you, it doesn't seem suitable for high-frequency updates :
github.com/facebook/react/issues/1...
(but maybe it has been improved since?)

Collapse
 
bytebodger profile image
Adam Nathaniel Davis

I agree that this "issue" is really what the Context API was designed for. Every time I've tried to dive in and use it myself, it just doesn't seem to "grok" properly in my brain. But that's not a React problem or a Context API problem. That's a me problem, and I just have to endeavor to make myself more comfortable with it so I can truly assess its faults-and-benefits.

Also... if you look under the covers, Redux basically is the Context API. That's what it's using.