diff --git a/src/components/connect.tsx b/src/components/connect.tsx index bdad73719..23d4c1828 100644 --- a/src/components/connect.tsx +++ b/src/components/connect.tsx @@ -641,13 +641,17 @@ function connect< }, [didStoreComeFromProps, contextValue, subscription]) // Set up refs to coordinate values between the subscription effect and the render logic - const lastChildProps = React.useRef() + const lastChildProps = React.useRef(undefined) const lastWrapperProps = React.useRef(wrapperProps) - const childPropsFromStoreUpdate = React.useRef() + const childPropsFromStoreUpdate = React.useRef(undefined) const renderIsScheduled = React.useRef(false) const isMounted = React.useRef(false) - const latestSubscriptionCallbackError = React.useRef() + // TODO: Change this to `React.useRef(undefined)` after upgrading to React 19. + /** + * @todo Change this to `React.useRef(undefined)` after upgrading to React 19. + */ + const latestSubscriptionCallbackError = React.useRef(undefined) useIsomorphicLayoutEffect(() => { isMounted.current = true @@ -752,11 +756,11 @@ function connect< const renderedWrappedComponent = React.useMemo(() => { return ( // @ts-ignore - - ) + />) + ); }, [reactReduxForwardedRef, WrappedComponent, actualChildProps]) // If React sees the exact same element reference as last time, it bails out of re-rendering