What is React Context future?


(Volodymyr Parandii) #1

Hello React Community!

Recently, during exploring of a new React V16.0.0 documentation, I’ve found this mind-breaking statement:

If you want your application to be stable, don’t use context. It is an experimental API and it is likely to break in future releases of React.
(https://reactjs.org/docs/context.html#why-not-to-use-context)

Being used Context api previously in narrow cases, where it was REALY needed, I’ve found this information very challenging :slight_smile:

So what is the suggested future of React Context API? Would it be replaced with an external module, some new pattern or removed at all? Any thoughts?

Many thanks!


(jalooc) #2

That’s a really good question.

I don’t know the answer, but I can only add, that this statement has been present in the docs for at least several React versions (or maybe even from the very beginning of React? I don’t actually remember the times when it wasn’t there).

One more thing is that many popular libraries depend on context, and that would be probably all the libraries that feature some kind of provider component, that should wrap your app: react-router, react-redux, mobX, react-apollo (because it’s based on redux), etc. Basing on that, I dare say, that Facebook won’t remove the context functionality without due preparation of the society.