pushProvider(provider) {
        const index = ++this.contextIndex;
        const context = provider.type._context;
        const previousValue = context._currentValue;

        // Remember which value to restore this context to on our way up.
        this.contextStack[index] = context;
        this.contextValueStack[index] = previousValue;

        // Mutate the current value.
        context._currentValue = provider.props.value;
    }
Note: We use just two stacks regardless of how many context providers you have.
Providers are always popped in the reverse order to how they were pushed
so we always know on the way down which provider you'll encounter next on the way up.
On the way down, we push the current provider, and its context value *before*
we mutated it, onto the stacks. Therefore, on the way up, we always know which
provider needs to be "restored" to which value.
https://github.com/facebook/react/pull/12985#issuecomment-396301248