Earlier this year, the React team introduced an improved context API. The new API made a big splash: it looks nicer, uses render functions, and to top it all off, it’s finally official. But one of the most important changes is hidden under the hood.
Until the new context API was released, React made it difficult to use context with
shouldComponentUpdate. To solve this problem, many developers turned to state management tools like Redux. But with the recent update, context now works great with
shouldComponentUpdate. So people have been asking the question: does context replace Redux?
To cut a long story short, context can replace Redux, but it won’t do everything that Redux does. In particular, it won’t perform any of the optimizations that Redux gives you for free. So before you replace Redux with context, there’s a thing or two that you should know about performance.