Context is an advanced feature and is subject to change. In some cases, its convenience outweighs its flaws, so some libraries, such as React Redux and React Router, prefer to rely on it, despite the experimental nature.
The important part here is the word library. If the context changes its behavior, we, as the authors of the library, will have to adapt. However, while the library does not ask you to directly use the context API, you, because the user does not need to worry about changes in it.
React Redux uses context inside, but it does not reveal this fact in the public API. Thus, you should feel much safer using the context with React Redux than directly, because if it changes, the burden of updating the code will be on React Redux, not on you.
Ultimately, React Redux still always supports the transfer of storage as a prop, so if you want to completely avoid the context, you have this choice. However, I would say that this is impractical.
TL; DR: Avoid using context directly unless you really know what you are doing. Using a library that relies on an internal context is relatively safe.
Dan Abramov Apr 05 '16 at 16:05 2016-04-05 16:05
source share