@@ -272,12 +272,16 @@ export default function connectAdvanced(
272
272
const usePureOnlyMemo = pure ? useMemo : callback => callback ( )
273
273
274
274
function ConnectFunction ( props ) {
275
- const [ propsContext , forwardedRef , wrapperProps ] = useMemo ( ( ) => {
275
+ const [
276
+ propsContext ,
277
+ reactReduxForwardedRef ,
278
+ wrapperProps
279
+ ] = useMemo ( ( ) => {
276
280
// Distinguish between actual "data" props that were passed to the wrapper component,
277
281
// and values needed to control behavior (forwarded refs, alternate context instances).
278
282
// To maintain the wrapperProps object reference, memoize this destructuring.
279
- const { forwardedRef , ...wrapperProps } = props
280
- return [ props . context , forwardedRef , wrapperProps ]
283
+ const { reactReduxForwardedRef , ...wrapperProps } = props
284
+ return [ props . context , reactReduxForwardedRef , wrapperProps ]
281
285
} , [ props ] )
282
286
283
287
const ContextToUse = useMemo ( ( ) => {
@@ -437,8 +441,13 @@ export default function connectAdvanced(
437
441
// Now that all that's done, we can finally try to actually render the child component.
438
442
// We memoize the elements for the rendered child component as an optimization.
439
443
const renderedWrappedComponent = useMemo (
440
- ( ) => < WrappedComponent { ...actualChildProps } ref = { forwardedRef } /> ,
441
- [ forwardedRef , WrappedComponent , actualChildProps ]
444
+ ( ) => (
445
+ < WrappedComponent
446
+ { ...actualChildProps }
447
+ ref = { reactReduxForwardedRef }
448
+ />
449
+ ) ,
450
+ [ reactReduxForwardedRef , WrappedComponent , actualChildProps ]
442
451
)
443
452
444
453
// If React sees the exact same element reference as last time, it bails out of re-rendering
@@ -472,7 +481,7 @@ export default function connectAdvanced(
472
481
props ,
473
482
ref
474
483
) {
475
- return < Connect { ...props } forwardedRef = { ref } />
484
+ return < Connect { ...props } reactReduxForwardedRef = { ref } />
476
485
} )
477
486
478
487
forwarded . displayName = displayName
0 commit comments