/** ========================================================= Vision UI PRO React - v1.0.0 ========================================================= Product Page: https://www.creative-tim.com/product/vision-ui-dashboard-pro-react Copyright 2021 Creative Tim (https://www.creative-tim.com/) Design and Coded by Simmmple & Creative Tim ========================================================= The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Visionware. */ import React, { useEffect } from "react"; import { useDispatch } from 'react-redux'; // Routes import AppRoutes from './routes'; // Providers import AppProviders from './providers/AppProviders'; // Components import GlobalComponents from './components/GlobalComponents'; // Hooks import { useGlobalErrorHandler } from './hooks/useGlobalErrorHandler'; // Redux import { initializePostHog } from './store/slices/posthogSlice'; // Utils import { logger } from './utils/logger'; /** * AppContent - 应用核心内容 * 负责 PostHog 初始化和渲染路由 */ function AppContent() { const dispatch = useDispatch(); // 🎯 PostHog Redux 初始化 useEffect(() => { dispatch(initializePostHog()); logger.info('App', 'PostHog Redux 初始化已触发'); }, [dispatch]); return ; } /** * App - 应用根组件 * 设置全局错误处理,提供 Provider 和全局组件 */ export default function App() { // 全局错误处理 useGlobalErrorHandler(); return ( ); }