diff --git a/src/components/connect.tsx b/src/components/connect.tsx index 19116df41..5ad3ba054 100644 --- a/src/components/connect.tsx +++ b/src/components/connect.tsx @@ -103,7 +103,6 @@ function subscribeUpdates( lastWrapperProps: React.MutableRefObject, lastChildProps: React.MutableRefObject, renderIsScheduled: React.MutableRefObject, - isMounted: React.MutableRefObject, childPropsFromStoreUpdate: React.MutableRefObject, notifyNestedSubs: () => void, // forceComponentUpdateDispatch: React.Dispatch, @@ -118,7 +117,7 @@ function subscribeUpdates( // We'll run this callback every time a store subscription update propagates to this component const checkForUpdates = () => { - if (didUnsubscribe || !isMounted.current) { + if (didUnsubscribe) { // Don't run stale listeners. // Redux doesn't guarantee unsubscriptions happen until next dispatch. return @@ -622,18 +621,9 @@ function connect< const lastWrapperProps = useRef(wrapperProps) const childPropsFromStoreUpdate = useRef() const renderIsScheduled = useRef(false) - const isProcessingDispatch = useRef(false) - const isMounted = useRef(false) const latestSubscriptionCallbackError = useRef() - useIsomorphicLayoutEffect(() => { - isMounted.current = true - return () => { - isMounted.current = false - } - }, []) - const actualChildPropsSelector = useMemo(() => { const selector = () => { // Tricky logic here: @@ -677,7 +667,6 @@ function connect< lastWrapperProps, lastChildProps, renderIsScheduled, - isMounted, childPropsFromStoreUpdate, notifyNestedSubs, reactListener