fix(web): 补全缺失的 web shims 并修复渲染崩溃问题

- 新增 sentry-react-native、react-native-video、react-native-static-server、expo-network、expo-intent-launcher、expo-clipboard、expo-file-system 的 web shim
- 重写 react-native-pager-view shim,通过 useImperativeHandle 暴露 setPage 方法
- 修复 sentry-react-native shim 缺少 ErrorBoundary 导致的渲染崩溃
- 在 _layout.tsx 中加载 Ionicons 字体,修复 web 端字体 404
- 更新 metro.config.js 中 sentry shim 路径为 .tsx
This commit is contained in:
Action
2026-03-24 21:21:15 +08:00
parent ce82f1be71
commit 6f7c99906b
10 changed files with 168 additions and 14 deletions

View File

@@ -9,6 +9,8 @@ import { useSettingsStore } from '../store/settingsStore';
import { MiniPlayer } from '../components/MiniPlayer';
import * as Sentry from '@sentry/react-native';
import { ErrorBoundary } from '@sentry/react-native';
import { useFonts } from 'expo-font';
import { Ionicons } from '@expo/vector-icons';
Sentry.init({
dsn: process.env.EXPO_PUBLIC_SENTRY_DSN ?? '',
@@ -22,13 +24,18 @@ function RootLayout() {
const loadDownloads = useDownloadStore(s => s.loadFromStorage);
const restoreSettings = useSettingsStore(s => s.restore);
const [fontsLoaded] = useFonts({
...Ionicons.font,
});
useEffect(() => {
restore();
loadDownloads();
restoreSettings();
}, []);
if (!fontsLoaded) return null;
return (
<SafeAreaProvider>
<StatusBar style="dark" />