Skip to content

Commit 9f1edde

Browse files
author
stefan.hausmann
committed
improved check whether context given as a prop is a real ReactContext
1 parent c046ae6 commit 9f1edde

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/connectAdvanced.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,12 @@ export default function connectAdvanced(
213213
}
214214

215215
render() {
216-
const ContextToUse = this.props.context && this.props.context.Consumer
217-
? this.props.context
218-
: Context
216+
const ContextToUse =
217+
this.props.context &&
218+
this.props.context.Provider &&
219+
this.props.context.Consumer
220+
? this.props.context
221+
: Context
219222

220223
return (
221224
<ContextToUse.Consumer>

0 commit comments

Comments
 (0)