Skip to content

Commit

Permalink
Revert "Move ref context binding to fix object freezing middleware (#733
Browse files Browse the repository at this point in the history
)"

This reverts commit 2118893.
  • Loading branch information
timdorr authored Jul 6, 2017
1 parent 2118893 commit 08336d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/connectAdvanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export default function connectAdvanced(
this.renderCount = 0
this.store = props[storeKey] || context[storeKey]
this.propsMode = Boolean(props[storeKey])
this.setWrappedInstance = this.setWrappedInstance.bind(this)

invariant(this.store,
`Could not find "${storeKey}" in either the context or props of ` +
Expand Down Expand Up @@ -239,7 +240,7 @@ export default function connectAdvanced(
// instance. a singleton memoized selector would then be holding a reference to the
// instance, preventing the instance from being garbage collected, and that would be bad
const withExtras = { ...props }
if (withRef) withExtras.ref = this.setWrappedInstance.bind(this)
if (withRef) withExtras.ref = this.setWrappedInstance
if (renderCountProp) withExtras[renderCountProp] = this.renderCount++
if (this.propsMode && this.subscription) withExtras[subscriptionKey] = this.subscription
return withExtras
Expand Down

0 comments on commit 08336d6

Please sign in to comment.