@@ -528,7 +528,6 @@ function connect<
528
528
const displayName = `Connect(${ wrappedComponentName } )`
529
529
530
530
const selectorFactoryOptions : SelectorFactoryOptions < any , any , any , any > = {
531
- pure,
532
531
shouldHandleStateChanges,
533
532
displayName,
534
533
wrappedComponentName,
@@ -543,11 +542,6 @@ function connect<
543
542
areMergedPropsEqual,
544
543
}
545
544
546
- // If we aren't running in "pure" mode, we don't want to memoize values.
547
- // To avoid conditionally calling hooks, we fall back to a tiny wrapper
548
- // that just executes the given callback immediately.
549
- const usePureOnlyMemo = pure ? useMemo : ( callback : ( ) => any ) => callback ( )
550
-
551
545
function ConnectFunction < TOwnProps > (
552
546
props : InternalConnectProps & TOwnProps
553
547
) {
@@ -667,7 +661,7 @@ function connect<
667
661
}
668
662
} , [ ] )
669
663
670
- const actualChildPropsSelector = usePureOnlyMemo ( ( ) => {
664
+ const actualChildPropsSelector = useMemo ( ( ) => {
671
665
const selector = ( ) => {
672
666
// Tricky logic here:
673
667
// - This render may have been triggered by a Redux store update that produced new child props
@@ -790,7 +784,6 @@ function connect<
790
784
return renderedChild
791
785
}
792
786
793
- // If we're in "pure" mode, ensure our wrapper component only re-renders when incoming props have changed.
794
787
const _Connect = React . memo ( ConnectFunction )
795
788
796
789
type ConnectedWrapperComponent = typeof _Connect & {
0 commit comments