fix: remove lazy load
This commit is contained in:
parent
8efed74b92
commit
935753f6b3
@ -6,11 +6,11 @@ import { FlatList, InteractionManager, PixelRatio, Platform, RefreshControl, Sty
|
||||
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||
|
||||
// 懒加载组件
|
||||
const ChatSvg = React.lazy(() => import('@/assets/icons/svg/chat.svg'));
|
||||
const AskNavbar = React.lazy(() => import('@/components/layout/ask'));
|
||||
const UploaderProgress = React.lazy(() => import('@/components/file-upload/upload-progress/uploader-progress'));
|
||||
const SkeletonItem = React.lazy(() => import('@/components/memo/SkeletonItem'));
|
||||
const ErrorBoundary = React.lazy(() => import('@/components/common/ErrorBoundary'));
|
||||
import ChatSvg from '@/assets/icons/svg/chat.svg';
|
||||
import AskNavbar from '@/components/layout/ask';
|
||||
import UploaderProgress from '@/components/file-upload/upload-progress/uploader-progress';
|
||||
import SkeletonItem from '@/components/memo/SkeletonItem';
|
||||
import ErrorBoundary from '@/components/common/ErrorBoundary';
|
||||
|
||||
// 类型定义
|
||||
import { useUploadManager } from '@/hooks/useUploadManager';
|
||||
@ -34,9 +34,7 @@ const preloadAssets = async () => {
|
||||
const SkeletonList = () => (
|
||||
<View style={styles.skeletonContainer}>
|
||||
{Array(5).fill(0).map((_, index) => (
|
||||
<React.Suspense key={`skeleton-${index}`} fallback={null}>
|
||||
<SkeletonItem />
|
||||
</React.Suspense>
|
||||
<SkeletonItem key={`skeleton-${index}`} />
|
||||
))}
|
||||
</View>
|
||||
);
|
||||
@ -145,13 +143,11 @@ const MemoList = () => {
|
||||
activeOpacity={0.7}
|
||||
>
|
||||
<View className="w-[3rem] h-[3rem] z-1">
|
||||
<React.Suspense fallback={<View style={styles.placeholderIcon} />}>
|
||||
<ChatSvg
|
||||
width="100%"
|
||||
height="100%"
|
||||
preserveAspectRatio="xMidYMid meet"
|
||||
/>
|
||||
</React.Suspense>
|
||||
</View>
|
||||
<View style={styles.memoContent}>
|
||||
<Text
|
||||
@ -180,9 +176,7 @@ const MemoList = () => {
|
||||
</Text>
|
||||
|
||||
{/* 上传进度 */}
|
||||
<React.Suspense fallback={null}>
|
||||
<UploadProgressSection />
|
||||
</React.Suspense>
|
||||
</View>
|
||||
), [insets.top]);
|
||||
|
||||
@ -226,9 +220,7 @@ const MemoList = () => {
|
||||
return (
|
||||
<View style={[styles.container, { paddingTop: insets.top }]}>
|
||||
<SkeletonList />
|
||||
<React.Suspense fallback={null}>
|
||||
<AskNavbar />
|
||||
</React.Suspense>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@ -267,9 +259,6 @@ const MemoList = () => {
|
||||
/>
|
||||
|
||||
{/* 底部导航栏 */}
|
||||
<React.Suspense fallback={null}>
|
||||
<AskNavbar />
|
||||
</React.Suspense>
|
||||
</View>
|
||||
</ErrorBoundary>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user