@@ -641,13 +641,17 @@ function connect<
641
641
} , [ didStoreComeFromProps , contextValue , subscription ] )
642
642
643
643
// Set up refs to coordinate values between the subscription effect and the render logic
644
- const lastChildProps = React . useRef < unknown > ( )
644
+ const lastChildProps = React . useRef < unknown > ( undefined )
645
645
const lastWrapperProps = React . useRef ( wrapperProps )
646
- const childPropsFromStoreUpdate = React . useRef < unknown > ( )
646
+ const childPropsFromStoreUpdate = React . useRef < unknown > ( undefined )
647
647
const renderIsScheduled = React . useRef ( false )
648
648
const isMounted = React . useRef ( false )
649
649
650
- const latestSubscriptionCallbackError = React . useRef < Error > ( )
650
+ // TODO: Change this to `React.useRef<Error>(undefined)` after upgrading to React 19.
651
+ /**
652
+ * @todo Change this to `React.useRef<Error>(undefined)` after upgrading to React 19.
653
+ */
654
+ const latestSubscriptionCallbackError = React . useRef < Error | undefined > ( undefined )
651
655
652
656
useIsomorphicLayoutEffect ( ( ) => {
653
657
isMounted . current = true
@@ -752,11 +756,11 @@ function connect<
752
756
const renderedWrappedComponent = React . useMemo ( ( ) => {
753
757
return (
754
758
// @ts -ignore
755
- < WrappedComponent
759
+ ( < WrappedComponent
756
760
{ ...actualChildProps }
757
761
ref = { reactReduxForwardedRef }
758
- />
759
- )
762
+ /> )
763
+ ) ;
760
764
} , [ reactReduxForwardedRef , WrappedComponent , actualChildProps ] )
761
765
762
766
// If React sees the exact same element reference as last time, it bails out of re-rendering
0 commit comments