Skip to content

Commit 87c06d2

Browse files
mountinyOSBotify
authored andcommitted
Merge pull request #45335 from margelo/fix/unexpected-unmount
(cherry picked from commit 8198564)
1 parent 37fa57e commit 87c06d2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/libs/freezeScreenWithLazyLoading.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import memoize from 'lodash/memoize';
12
import React from 'react';
23
import FreezeWrapper from './Navigation/FreezeWrapper';
34

@@ -13,8 +14,8 @@ function FrozenScreen<TProps extends React.JSX.IntrinsicAttributes>(WrappedCompo
1314
}
1415

1516
export default function freezeScreenWithLazyLoading(lazyComponent: () => React.ComponentType) {
16-
return () => {
17+
return memoize(() => {
1718
const Component = lazyComponent();
1819
return FrozenScreen(Component);
19-
};
20+
});
2021
}

0 commit comments

Comments
 (0)