Skip to content

Commit ae2e174

Browse files
committed
Merge branch 'master' of https://github.com/reduxjs/react-redux into migrate-typetests-to-vitest
2 parents ac8af6e + 5ec7970 commit ae2e174

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/components/connect.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -641,13 +641,17 @@ function connect<
641641
}, [didStoreComeFromProps, contextValue, subscription])
642642

643643
// 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)
645645
const lastWrapperProps = React.useRef(wrapperProps)
646-
const childPropsFromStoreUpdate = React.useRef<unknown>()
646+
const childPropsFromStoreUpdate = React.useRef<unknown>(undefined)
647647
const renderIsScheduled = React.useRef(false)
648648
const isMounted = React.useRef(false)
649649

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)
651655

652656
useIsomorphicLayoutEffect(() => {
653657
isMounted.current = true
@@ -752,11 +756,11 @@ function connect<
752756
const renderedWrappedComponent = React.useMemo(() => {
753757
return (
754758
// @ts-ignore
755-
<WrappedComponent
759+
(<WrappedComponent
756760
{...actualChildProps}
757761
ref={reactReduxForwardedRef}
758-
/>
759-
)
762+
/>)
763+
);
760764
}, [reactReduxForwardedRef, WrappedComponent, actualChildProps])
761765

762766
// If React sees the exact same element reference as last time, it bails out of re-rendering

0 commit comments

Comments
 (0)