Same as https://github.com/facebook/react/issues/10103, but for the server renderer. You can look at implementation in https://github.com/facebook/react/pull/11168 and do something very similar in `ReactPartialRenderer.js`.
render() {
        return this.props.children;
      }
    }
    class Child extends React.Component {
      static contextTypes = {
        foo: PropTypes.string,
        flag: PropTypes.bool,
      };
      render() {
        childInstance = this;
        return <span>Child</span>;
      }
    }
    parentInstance = ReactTestUtils.renderIntoDocument(
      <Parent>
        <Middle>
          <Child />
        </Middle>
      </Parent>,
    );
    expect(parentInstance.state.flag).toBe(false);
    expect(childInstance.context).toEqual({foo: 'bar', flag: false});
    parentInstance.setState({flag: true});
    expect(parentInstance.state.flag).toBe(true);
    expect(childInstance.context).toEqual({foo: 'bar', flag: true});
  });
  it('should pass context when re-rendered for static child within a composite component', () => {
    class Parent extends React.Component {