Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP Staging] fix: frequent component re-mount #45335

Merged
merged 12 commits into from
Jul 15, 2024
5 changes: 3 additions & 2 deletions src/libs/freezeScreenWithLazyLoading.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import memoize from 'lodash/memoize';
import React from 'react';
import FreezeWrapper from './Navigation/FreezeWrapper';

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

export default function freezeScreenWithLazyLoading(lazyComponent: () => React.ComponentType) {
return () => {
return memoize(() => {
const Component = lazyComponent();
return FrozenScreen(Component);
};
});
}
Loading