Skip to content

Commit

Permalink
Fix custom context as a prop usage
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Nov 6, 2018
1 parent 58dcf33 commit 2d06cdf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/connectAdvanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ export default function connectAdvanced(

if(pure) {
OuterBaseComponent = PureComponent
//FinalWrappedComponent = React.memo(WrappedComponent)
}

class PureWrapper extends Component {
Expand Down Expand Up @@ -207,10 +206,12 @@ export default function connectAdvanced(
}

render() {
const ContextToUse = this.props.context || Context

return (
<Context.Consumer>
<ContextToUse.Consumer>
{this.renderWrappedComponent}
</Context.Consumer>
</ContextToUse.Consumer>
)
}
}
Expand Down

0 comments on commit 2d06cdf

Please sign in to comment.