Skip to content

Commit bd05362

Browse files
committed
Revert "Move ref context binding to fix object freezing middleware (reduxjs#733)"
This reverts commit 2118893.
1 parent 2118893 commit bd05362

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/connectAdvanced.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ export default function connectAdvanced(
121121
this.renderCount = 0
122122
this.store = props[storeKey] || context[storeKey]
123123
this.propsMode = Boolean(props[storeKey])
124+
this.setWrappedInstance = this.setWrappedInstance.bind(this)
124125

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

0 commit comments

Comments
 (0)