diff --git a/src/ReactShallowRenderer.js b/src/ReactShallowRenderer.js index 4f33ca5..4dc0919 100644 --- a/src/ReactShallowRenderer.js +++ b/src/ReactShallowRenderer.js @@ -515,7 +515,9 @@ See https://fb.me/react-invalid-hook-call for tips about how to debug and fix th this._rendering = true; this._element = element; - this._context = getMaskedContext(elementType.contextTypes, context); + this._context = elementType.contextType + ? context + : getMaskedContext(elementType.contextTypes, context); // Inner memo component props aren't currently validated in createElement. let prevGetStack;