Skip to content

Commit 2d06cdf

Browse files
committed
Fix custom context as a prop usage
1 parent 58dcf33 commit 2d06cdf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/connectAdvanced.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ export default function connectAdvanced(
110110

111111
if(pure) {
112112
OuterBaseComponent = PureComponent
113-
//FinalWrappedComponent = React.memo(WrappedComponent)
114113
}
115114

116115
class PureWrapper extends Component {
@@ -207,10 +206,12 @@ export default function connectAdvanced(
207206
}
208207

209208
render() {
209+
const ContextToUse = this.props.context || Context
210+
210211
return (
211-
<Context.Consumer>
212+
<ContextToUse.Consumer>
212213
{this.renderWrappedComponent}
213-
</Context.Consumer>
214+
</ContextToUse.Consumer>
214215
)
215216
}
216217
}

0 commit comments

Comments
 (0)