Now we are moving to React 16, I'm surprised that there are zero change in context(and it remains experimental and possibly break in the future). Libraries like react-redux and react-router heavily depends on using context, because it is experimental, shouldCompomentUpdate and pureComponent will not check context at all. That causes some extra work to be done just to make react-router working with react-redux(like you have to wrap every component with withRouter to map context to props). And to me, it is not beautiful.
Can we formally accept context as the solution and let API take it into consideration or just find a better solution in the next version of React ?
Hi!
We are very well aware of the problems with context. However React 16 is focused on getting a completely rewritten engine (Fiber) out of the door with as much backwards compatibility as we can do.
We know both that libraries depend on context, and that its API has fundamental flaws. These flaws are exactly why it's called "experimental": unlike with most APIs, we know we will need to change it to solve them in future releases. But we'll provide a migration path for libraries, just like we need a migration path for our own code.
So, to sum up, we won't do this in 16, but might in 17. We won't remove the "experimental" label until it's an API we actually like and until fundamental flaws are solved.
Most helpful comment
Hi!
We are very well aware of the problems with context. However React 16 is focused on getting a completely rewritten engine (Fiber) out of the door with as much backwards compatibility as we can do.
We know both that libraries depend on context, and that its API has fundamental flaws. These flaws are exactly why it's called "experimental": unlike with most APIs, we know we will need to change it to solve them in future releases. But we'll provide a migration path for libraries, just like we need a migration path for our own code.
So, to sum up, we won't do this in 16, but might in 17. We won't remove the "experimental" label until it's an API we actually like and until fundamental flaws are solved.